home *** CD-ROM | disk | FTP | other *** search
/ The World's Largest Collection of Windows Software / The World's Largest Collection of Windows Software - Disc 1.iso / connect / _j2 / wvnsc926 / rcs / wvcncm.c < prev    next >
C/C++ Source or Header  |  1994-09-21  |  101KB  |  3,851 lines

  1. head     1.32;
  2. branch   ;
  3. access   ;
  4. symbols  V80:1.6 V76d:1.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.32
  10. date     94.09.19.00.24.57;  author jcooper;  state Exp;
  11. branches ;
  12. next     1.31;
  13.  
  14. 1.31
  15. date     94.09.16.00.46.55;  author jcooper;  state Exp;
  16. branches ;
  17. next     1.30;
  18.  
  19. 1.30
  20. date     94.09.06.12.46.59;  author rushing;  state Exp;
  21. branches ;
  22. next     1.29;
  23.  
  24. 1.29
  25. date     94.08.24.18.00.29;  author jcooper;  state Exp;
  26. branches ;
  27. next     1.28;
  28.  
  29. 1.28
  30. date     94.08.11.00.09.17;  author jcooper;  state Exp;
  31. branches ;
  32. next     1.27;
  33.  
  34. 1.27
  35. date     94.07.25.22.41.22;  author pearse_w_r;  state Exp;
  36. branches ;
  37. next     1.26;
  38.  
  39. 1.26
  40. date     94.07.25.18.51.48;  author jcooper;  state Exp;
  41. branches ;
  42. next     1.25;
  43.  
  44. 1.25
  45. date     94.06.08.21.01.45;  author gardnerd;  state Exp;
  46. branches ;
  47. next     1.24;
  48.  
  49. 1.24
  50. date     94.05.26.22.11.04;  author jglasser;  state Exp;
  51. branches ;
  52. next     1.23;
  53.  
  54. 1.23
  55. date     94.05.23.19.51.51;  author rushing;  state Exp;
  56. branches ;
  57. next     1.22;
  58.  
  59. 1.22
  60. date     94.05.23.18.37.00;  author jcooper;  state Exp;
  61. branches ;
  62. next     1.21;
  63.  
  64. 1.21
  65. date     94.05.02.19.49.56;  author rushing;  state Exp;
  66. branches ;
  67. next     1.20;
  68.  
  69. 1.20
  70. date     94.03.01.19.10.19;  author rushing;  state Exp;
  71. branches ;
  72. next     1.19;
  73.  
  74. 1.19
  75. date     94.02.24.21.27.28;  author jcoop;  state Exp;
  76. branches ;
  77. next     1.18;
  78.  
  79. 1.18
  80. date     94.01.24.17.39.47;  author jcoop;  state Exp;
  81. branches ;
  82. next     1.17;
  83.  
  84. 1.17
  85. date     94.01.16.12.02.59;  author jcoop;  state Exp;
  86. branches ;
  87. next     1.16;
  88.  
  89. 1.16
  90. date     94.01.12.19.27.32;  author mrr;  state Exp;
  91. branches ;
  92. next     1.15;
  93.  
  94. 1.15
  95. date     93.12.08.01.27.21;  author rushing;  state Exp;
  96. branches ;
  97. next     1.14;
  98.  
  99. 1.14
  100. date     93.08.25.18.53.17;  author mbretherton;  state Exp;
  101. branches ;
  102. next     1.13;
  103.  
  104. 1.13
  105. date     93.08.25.17.05.17;  author mbretherton;  state Exp;
  106. branches ;
  107. next     1.12;
  108.  
  109. 1.12
  110. date     93.08.05.20.06.07;  author jcoop;  state Exp;
  111. branches ;
  112. next     1.11;
  113.  
  114. 1.11
  115. date     93.07.13.16.03.04;  author riordan;  state Exp;
  116. branches ;
  117. next     1.10;
  118.  
  119. 1.10
  120. date     93.06.26.00.25.11;  author rushing;  state Exp;
  121. branches ;
  122. next     1.9;
  123.  
  124. 1.9
  125. date     93.06.25.20.49.28;  author dumoulin;  state Exp;
  126. branches ;
  127. next     1.8;
  128.  
  129. 1.8
  130. date     93.06.22.19.44.42;  author rushing;  state Exp;
  131. branches ;
  132. next     1.7;
  133.  
  134. 1.7
  135. date     93.06.22.19.09.14;  author rushing;  state Exp;
  136. branches ;
  137. next     1.6;
  138.  
  139. 1.6
  140. date     93.05.28.17.18.00;  author rushing;  state Exp;
  141. branches ;
  142. next     1.5;
  143.  
  144. 1.5
  145. date     93.05.24.23.24.26;  author rushing;  state Exp;
  146. branches ;
  147. next     1.4;
  148.  
  149. 1.4
  150. date     93.05.18.22.10.45;  author rushing;  state Exp;
  151. branches ;
  152. next     1.3;
  153.  
  154. 1.3
  155. date     93.05.13.19.59.11;  author rushing;  state Exp;
  156. branches ;
  157. next     1.2;
  158.  
  159. 1.2
  160. date     93.05.13.16.17.00;  author rushing;  state Exp;
  161. branches ;
  162. next     1.1;
  163.  
  164. 1.1
  165. date     93.02.16.20.53.50;  author rushing;  state Exp;
  166. branches ;
  167. next     ;
  168.  
  169.  
  170. desc
  171. @winvn version 0.76 placed into RCS
  172. @
  173.  
  174.  
  175. 1.32
  176. log
  177. @Disable MAPI in win32s.  Force a repaint on change of thread show-full-
  178. subject
  179. @
  180. text
  181. @/*
  182.  *
  183.  * $Id: wvcncm.c 1.31 1994/09/16 00:46:55 jcooper Exp $
  184.  * $Log: wvcncm.c $
  185.  * Revision 1.31  1994/09/16  00:46:55  jcooper
  186.  * New SmartFiler, Cc-by-mail dialogs.  massive cleanup for 92.6
  187.  * 
  188.  * Revision 1.29  1994/08/24  18:00:29  jcooper
  189.  * misc encoding/decoding changes
  190.  *
  191.  * Revision 1.28  1994/08/11  00:09:17  jcooper
  192.  * Enhancements to Mime and article encoding/encoding
  193.  *
  194.  * Revision 1.27  1994/07/25  22:41:22  pearse_w_r
  195.  * ShowUnreadOnly option
  196.  *
  197.  * Revision 1.26  1994/07/25  18:51:48  jcooper
  198.  * execution of decoded files
  199.  *
  200.  * Revision 1.25  1994/06/08  21:01:45  gardnerd
  201.  * more scrolling changes...
  202.  *
  203.  * Revision 1.24  1994/05/26  22:11:04  jglasser
  204.  * warnings
  205.  *
  206.  * Revision 1.23  1994/05/23  19:51:51  rushing
  207.  * NNTPPort becomes NNTPService, and it's a string.
  208.  *
  209.  * Revision 1.22  1994/05/23  18:37:00  jcooper
  210.  * new attach code, session [dis]connect
  211.  *
  212.  * Revision 1.21  1994/05/02  19:49:56  rushing
  213.  * changes from jody glasser
  214.  *
  215.  * Revision 1.20  1994/03/01  19:10:19  rushing
  216.  * ThreadFullSubject option added
  217.  *
  218.  * Revision 1.19  1994/02/24  21:27:28  jcoop
  219.  * jcoop changes
  220.  *
  221.  * Revision 1.18  1994/01/24  17:39:47  jcoop
  222.  * 90.2 changes
  223.  *
  224.  * Revision 1.17  1994/01/16  12:02:59  jcoop
  225.  * INI stuff now all written in winvn.c.  New dialogs for en/decoding
  226.  *
  227.  * Revision 1.16  1994/01/12  19:27:32  mrr
  228.  * mrr mods 4
  229.  * 
  230.  * Revision 1.15  1993/12/08  01:27:21  rushing
  231.  * new version box and cr lf consistency
  232.  *
  233.  * Revision 1.14  1993/08/25  18:53:17  mbretherton
  234.  * MRB merge, mail & post logging
  235.  *
  236.  *
  237.  * Bretherton
  238.  *  activate mail type after user change and add logging dialog
  239.  *
  240.  * Revision 1.13  1993/08/25  17:05:17  mbretherton
  241.  * merge from first newsrc.zip
  242.  *
  243.  *
  244.  * Bretherton
  245.  * activate mail type after user change and add logging dialog
  246.  *
  247.  * Revision 1.12  1993/08/05  20:06:07  jcoop
  248.  * save multiple articles changes by jcoop@@oakb2s01.apl.com (John S Cooper)
  249.  *
  250.  * Revision 1.11  1993/07/13  16:03:04  riordan
  251.  * MRR mods
  252.  *
  253.  * Revision 1.10  1993/06/26  00:25:11  rushing
  254.  * warnings
  255.  *
  256.  * Revision 1.9  1993/06/25  20:49:28  dumoulin
  257.  * Cleaned up compiler warnings
  258.  *
  259.  * Revision 1.8  1993/06/22  19:44:42  rushing
  260.  * fixed IDD_MAIL_SELECT_AUTO
  261.  *
  262.  * Revision 1.7  1993/06/22  19:09:14  rushing
  263.  * mail force type selection via dialog
  264.  *
  265.  * Revision 1.6  1993/05/28  17:18:00  rushing
  266.  * Added Misc... option to enable threading
  267.  *
  268.  * Revision 1.5  1993/05/24  23:24:26  rushing
  269.  * change NNTPHost->SMTP Host for Comm... Dialog
  270.  *
  271.  * Revision 1.4  1993/05/18  22:10:45  rushing
  272.  * smtp support
  273.  *
  274.  * Revision 1.3  1993/05/13  19:59:11  rushing
  275.  * fancy 'from' in group window
  276.  *
  277.  * Revision 1.2  1993/05/13  16:17:00  rushing
  278.  * article fetch limit dialog box
  279.  *
  280.  * Revision 1.1  1993/02/16  20:53:50  rushing
  281.  * Initial revision
  282.  *
  283.  *
  284.  */
  285.  
  286. /*-- This is the first line of WVCNCM.C -------------------------------*/
  287.  
  288. #include <windows.h>
  289. #include <windowsx.h>
  290. #include "wvglob.h"
  291. #include "winvn.h"
  292. #pragma hdrstop
  293. #include <stdlib.h>
  294. #include <limits.h>
  295. #include <io.h>            // for _access
  296.  
  297. extern int WinVnDoComm (char *);
  298. int saveMailForceType ;
  299. void enableDemandLogonCtl( HWND hDlg, int forceType);
  300. void SetupEncodingOptions (HWND hDlg);
  301. BOOL ProcessEncodingOptions (HWND hDlg);
  302.  
  303. /*-- function WinVnCommDlg ---------------------------------------------
  304.  *
  305.  *   Dialog function to process the Configure Communications
  306.  *   dialog box.
  307.  */
  308.  
  309. BOOL FAR PASCAL 
  310. WinVnCommDlg (hDlg, iMessage, wParam, lParam)
  311.      HWND hDlg;
  312.      unsigned iMessage;
  313.      WORD wParam;
  314.      LONG lParam;
  315. {
  316. #define MAXSTR  32
  317.   static int MyCommPortID;
  318.   static int MyCommParityID;
  319.   static int MyCommModeID;
  320.   static int SaveDemand ;
  321.   static char pszMyCommSpeed[MAXCOMMSPEEDCHARS];
  322.   static char pszMyNNTPService[MAXSTR];
  323.   int mail_force_radio;
  324.   int write_ini = FALSE;
  325.   char NNTPPassword[MAXNNTPSIZE];
  326. // char *cptr;
  327.  
  328.   switch (iMessage)
  329.     {
  330.  
  331.     case WM_INITDIALOG:
  332. #if 0
  333.       if (AskComm == ASK_COMM_INITIAL)
  334.    AskComm = ASK_COMM_NEVER;
  335.       MyCommPortID = CommPortID;
  336.       MyCommParityID = CommParityID;
  337.       strcpy (pszMyCommSpeed, pszCommSpeed);
  338.       MyCommModeID = (UsingSocket ? ID_COMMTCP : ID_COMMSERIAL);
  339.  
  340.       CheckRadioButton (hDlg, IDD_COM1, IDD_COM2, CommPortID);
  341.       CheckRadioButton (hDlg, IDD_7EVEN, IDD_8NONE, CommParityID);
  342.       CheckRadioButton (hDlg, ID_COMMTCP, ID_COMMSERIAL, MyCommModeID);
  343.       CheckDlgButton (hDlg, ID_CONFIG_ASK_COMM, AskComm);
  344.       SetDlgItemText (hDlg, IDD_SPEED, pszMyCommSpeed);
  345. #endif
  346.       SetDlgItemText (hDlg, ID_CONFIG_NNTP_SERVER, NNTPHost);
  347.       SetDlgItemText (hDlg, ID_CONFIG_SMTP_SERVER, SMTPHost);
  348.       SetDlgItemText (hDlg, ID_CONFIG_NNTP_PORT, NNTPService);
  349.       SetDlgItemText (hDlg, ID_CONFIG_AUTH_USERNAME, NNTPUserName);
  350.       MRRDecrypt(NNTPPasswordEncrypted,(unsigned char *)NNTPPassword, MAXNNTPSIZE);
  351.       SetDlgItemText (hDlg, ID_CONFIG_AUTH_PASSWORD, NNTPPassword);
  352. #ifdef WIN32
  353.       if (GetVersion() == 1)    /* win32s */
  354.          EnableWindow(GetDlgItem(hDlg, IDD_MAIL_SELECT_MAPI), FALSE);
  355. #endif
  356.       saveMailForceType=MailForceType ;
  357.       if (MailForceType == -1)
  358.    mail_force_radio = IDD_MAIL_SELECT_AUTO;
  359.       else
  360.    mail_force_radio = MailForceType + IDD_MAIL_SELECT_NONE;
  361.  
  362.       CheckRadioButton (hDlg, IDD_MAIL_SELECT_NONE,
  363.          IDD_MAIL_SELECT_AUTO, mail_force_radio);
  364.  
  365.       SaveDemand = MailDemandLogon ;
  366.       CheckDlgButton (hDlg, IDD_DEMANDLOGON, SaveDemand);
  367.       enableDemandLogonCtl(hDlg,saveMailForceType) ;
  368.  
  369.       return TRUE;
  370.  
  371.       break;
  372.  
  373.     case WM_COMMAND:
  374.       switch (wParam)
  375.    {
  376.    case ID_OK_SAVE:
  377.      write_ini = TRUE;
  378.    case IDOK:
  379. #if 0
  380. /* disabled serial code... */
  381.      GetDlgItemText(hDlg, IDD_SPEED, pszCommSpeed, MAXCOMMSPEEDCHARS - 1);
  382.      CommPortID = MyCommPortID;
  383.      CommParityID = MyCommParityID;
  384.      CommIDtoStr (CommPortID, CommParityID, pszCommSpeed, szCommString);
  385.      WinVnDoComm (szCommString);
  386.  
  387.      if (Initializing)
  388.        UsingSocket = (MyCommModeID == ID_COMMTCP);
  389. #endif
  390.      UsingSocket = 1;
  391.      GetDlgItemText (hDlg, ID_CONFIG_NNTP_SERVER, NNTPHost, MAXNNTPSIZE);
  392.      GetDlgItemText (hDlg, ID_CONFIG_SMTP_SERVER, SMTPHost, MAXNNTPSIZE); 
  393.      GetDlgItemText (hDlg, ID_CONFIG_NNTP_PORT, NNTPService, MAXNNTPSIZE);
  394.      GetDlgItemText (hDlg, ID_CONFIG_AUTH_USERNAME, NNTPUserName, MAXNNTPSIZE);
  395.      GetDlgItemText (hDlg, ID_CONFIG_AUTH_PASSWORD, NNTPPassword, MAXNNTPSIZE);
  396.      MRREncrypt((unsigned char *)NNTPPassword,strlen(NNTPPassword)+1,
  397.      NNTPPasswordEncrypted);
  398.      AskComm = IsDlgButtonChecked (hDlg, ID_CONFIG_ASK_COMM);
  399.      MailDemandLogon = SaveDemand ;
  400.  
  401.  
  402. /*      if (write_ini)    (JSC - Now write on exit of app)
  403.         {
  404. //          WritePrivateProfileString
  405. //        (szAppName, "CommString", szCommString, szAppProFile);
  406.           WritePrivateProfileString
  407.         (szAppName, "NNTPHost", NNTPHost, szAppProFile);
  408.           WritePrivateProfileString
  409.         (szAppName, "SMTPHost", SMTPHost, szAppProFile);
  410.           WritePrivateProfileString
  411.         (szAppName, "NNTPService", NNTPService, szAppProFile);
  412.         WritePrivateProfileString
  413.         (szAppName, "NNTPUserName", NNTPUserName, szAppProFile);
  414.         WritePrivateProfileString
  415.         (szAppName, "NNTPPassword", NNTPPasswordEncrypted, szAppProFile);
  416.           WritePrivateProfileInt (szAppName, "MailForceType",
  417.                       saveMailForceType, szAppProFile);
  418.           WritePrivateProfileInt (szAppName, "MailDemandLogon",
  419.                       MailDemandLogon, szAppProFile);
  420.  
  421.  
  422. //         cptr = MyCommModeID == ID_COMMTCP ? "1" : "0";
  423. //         WritePrivateProfileString (szAppName, "UseSocket", cptr, szAppProFile);
  424. //         WritePrivateProfileInt (szAppName, "AskComm", AskComm, szAppProFile);
  425.  
  426.        }
  427. */
  428.      if (saveMailForceType!=MailForceType)
  429.      {/* change of mail transport medium
  430.          Not entirely correct as may change from
  431.          explicit selection to auto detect which
  432.          in this case will (but in reality may not)
  433.          affect a relogin to mail)  */
  434.          MailForceType=saveMailForceType;
  435.          MailCrashExit(hDlg);
  436.          MailInit (hDlg);
  437.          UpdateAllMailMenus();
  438.      }
  439.      EndDialog (hDlg, TRUE);
  440.      break;
  441.  
  442.    case IDCANCEL:
  443.      EndDialog (hDlg, FALSE);
  444.      break;
  445.  
  446. #if 0
  447.    case ID_COMMTCP:
  448.    case ID_COMMSERIAL:
  449.      MyCommModeID = wParam;
  450.      CheckRadioButton (hDlg, ID_COMMTCP, ID_COMMSERIAL, MyCommModeID);
  451.      break;
  452.  
  453.    case IDD_COM1:
  454.    case IDD_COM2:
  455.      MyCommPortID = wParam;
  456.      CheckRadioButton (hDlg, IDD_COM1, IDD_COM2, wParam);
  457.      break;
  458.  
  459.    case IDD_7EVEN:
  460.    case IDD_8NONE:
  461.      MyCommParityID = wParam;
  462.      CheckRadioButton (hDlg, IDD_7EVEN, IDD_8NONE, wParam);
  463.      break;
  464. #endif
  465.  
  466.    case IDD_MAIL_SELECT_NONE:
  467.    case IDD_MAIL_SELECT_MAPI:   
  468.    case IDD_MAIL_SELECT_SMTP:
  469.      saveMailForceType = wParam - IDD_MAIL_SELECT_NONE;
  470.      enableDemandLogonCtl(hDlg,saveMailForceType) ;
  471.      break;
  472.  
  473.    case IDD_MAIL_SELECT_AUTO:
  474.      saveMailForceType = -1;
  475.      enableDemandLogonCtl(hDlg,saveMailForceType) ;
  476.           break;
  477.  
  478.    case IDD_DEMANDLOGON:
  479.      SaveDemand = !SaveDemand;
  480.      CheckDlgButton (hDlg, IDD_DEMANDLOGON, SaveDemand);
  481.      break;
  482.  
  483.    default:
  484.      return FALSE;
  485.    }
  486.    break;
  487.    
  488.  default:
  489.    return FALSE;
  490.    break;
  491.  }
  492.   return TRUE;
  493. }
  494. /*
  495.  *  enable/disable the check box for the DemandLogon variable
  496.  *  as requested
  497.  *
  498.  *  some mail transports do not require authentification (logon)
  499.  *  so demand (deferred ) logon is not an option 
  500.  *
  501.  */  
  502. void enableDemandLogonCtl( HWND hDlg, int forceType)
  503. {
  504.    EnableWindow(GetDlgItem(hDlg,IDD_DEMANDLOGON),
  505.       (forceType==-1) || (forceType==MT_MAPI) );
  506. }
  507.  
  508. /*--- Function CommIDtoStr --------------------------------------
  509.  *
  510.  *   Takes information relating to comm port configuration and creates
  511.  *   a string of the form to give to the MODE command.
  512.  *
  513.  *   Entry    Port      is the port (an IDD_* variable)
  514.  *            Parity    is the parity/data bits infor (an IDD_* variable)
  515.  *            szSpeed     is the speed, in character form
  516.  *
  517.  *   Exit     CommStr    is the string; e.g., "COM1:2400,n,8"
  518.  *            Function value is non-zero if error.
  519.  */
  520. int
  521. CommIDtoStr (Port, Parity, szSpeed, CommStr)
  522.      int Port, Parity;
  523.      char *szSpeed;
  524.      char *CommStr;
  525. {
  526.   register char *ptr;
  527.  
  528.   ptr = CommStr;
  529.   strcpy (ptr, "COM");
  530.   ptr += 3;
  531.   *(ptr++) = (char) (Port == IDD_COM1 ? '1' : '2');
  532.   *(ptr++) = ':';
  533.  
  534.   for (; *szSpeed; *(ptr++) = *(szSpeed++));
  535.   *(ptr++) = ',';
  536.   if (Parity == IDD_7EVEN)
  537.     {
  538.       strcpy (ptr, "e,7");
  539.     }
  540.   else
  541.     {
  542.       strcpy (ptr, "n,8");
  543.     }
  544.  
  545.   return (0);
  546. }
  547.  
  548. /*-- function WinVnSaveArtDlg ---------------------------------------
  549.  *
  550.  *  Dialog function to handle Save Article dialog box.
  551.  */
  552.  
  553. BOOL FAR PASCAL 
  554. WinVnSaveArtDlg (hDlg, iMessage, wParam, lParam)
  555.      HWND hDlg;
  556.      unsigned iMessage;
  557.      WORD wParam;
  558.      LONG lParam;
  559. {
  560.   static int MyAppend;
  561.   char fileName[MAXFILENAME];
  562.  
  563.   switch (iMessage)
  564.     {
  565.  
  566.     case WM_INITDIALOG:
  567.       MyAppend = SaveArtAppend;
  568.  
  569.       CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  570.       SetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName);
  571.       return TRUE;
  572.       break;
  573.  
  574.     case WM_COMMAND:
  575.       switch (wParam)
  576.    {
  577.    case IDOK:
  578.      GetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName, MAXFILENAME - 1);
  579.  
  580.      SaveArtAppend = MyAppend;
  581.      if (!MRRWriteDocument (ActiveArticleDoc, sizeof (TypText), SaveArtFileName, SaveArtAppend))
  582.        {
  583.          MessageBox (hWndConf, "Could not write to file", "Problems saving file", MB_OK | MB_ICONEXCLAMATION);
  584.        }
  585.      EndDialog (hDlg, TRUE);
  586.      break;
  587.  
  588.    case ID_BROWSE:
  589.      fileName[0]='\0';
  590.      if (AskForNewFileName (hDlg, fileName, "", MyAppend) == SUCCESS)
  591.        SetDlgItemText (hDlg, IDD_FILENAME, fileName);
  592.      break;
  593.  
  594.    case IDCANCEL:
  595.      EndDialog (hDlg, FALSE);
  596.      break;
  597.  
  598.    case IDD_APPEND:
  599.      MyAppend = !MyAppend;
  600.      CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  601.      break;
  602.  
  603.    default:
  604.      return FALSE;
  605.    }
  606.       break;
  607.  
  608.     default:
  609.       return FALSE;
  610.       break;
  611.     }
  612.   return TRUE;
  613. }
  614.  
  615. /*-- function WinVnSaveArtsDlg ---------------------------------------
  616.  *
  617.  *  Dialog function to handle Save Articles dialog box.
  618.  *  Same as Save Article dialog, except actual save is deferred until
  619.  *  later (When IDM_RETRIEVE_COMPLETE Message gets sent to Group win)
  620.  *  (JSC)
  621.  */
  622.  
  623. BOOL FAR PASCAL 
  624. WinVnSaveArtsDlg (hDlg, iMessage, wParam, lParam)
  625.      HWND hDlg;
  626.      unsigned iMessage;
  627.      WORD wParam;
  628.      LONG lParam;
  629. {
  630.   static int MyAppend;
  631.   char fileName[MAXFILENAME];
  632.  
  633.   switch (iMessage)
  634.     {
  635.  
  636.     case WM_INITDIALOG:
  637.       MyAppend = SaveArtAppend;
  638.  
  639.       CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  640.       CheckDlgButton (hDlg, IDD_KEEP_HEADER_VISIBLE, KeepArticleHeaderVisible);
  641.       SetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName);
  642.       return TRUE;
  643.       break;
  644.  
  645.     case WM_COMMAND:
  646.       switch (wParam)
  647.    {
  648.    case IDOK:
  649.      GetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName, MAXFILENAME - 1);
  650.      KeepArticleHeaderVisible = IsDlgButtonChecked (hDlg, IDD_KEEP_HEADER_VISIBLE);
  651.      SaveArtAppend = MyAppend;
  652.      EndDialog (hDlg, TRUE);
  653.      break;
  654.  
  655.    case ID_BROWSE:
  656.      fileName[0]='\0';
  657.      if (AskForNewFileName (hDlg, fileName, "", MyAppend) == SUCCESS)
  658.        SetDlgItemText (hDlg, IDD_FILENAME, fileName);
  659.      break;
  660.    
  661.    case IDCANCEL:
  662.      EndDialog (hDlg, FALSE);
  663.      break;
  664.  
  665.    case IDD_APPEND:
  666.      MyAppend = !MyAppend;
  667.      CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  668.      break;
  669.  
  670.    default:
  671.      return FALSE;
  672.    }
  673.       break;
  674.  
  675.     default:
  676.       return FALSE;
  677.       break;
  678.     }
  679.   return TRUE;
  680. }
  681.  
  682. /*-- function WinVnDecodeArtsDlg ---------------------------------------
  683.  *
  684.  *  Dialog function to handle Decode Articles dialog box.
  685.  *  (JSC)
  686.  */
  687.  
  688. BOOL FAR PASCAL 
  689. WinVnDecodeArtsDlg (hDlg, iMessage, wParam, lParam)
  690.      HWND hDlg;
  691.      unsigned iMessage;
  692.      WORD wParam;
  693.      LONG lParam;
  694. {
  695.   int len;
  696.  
  697.   switch (iMessage)
  698.     {
  699.  
  700.     case WM_INITDIALOG:
  701.       SetDlgItemText (hDlg, IDD_DECODE_PATH, DecodePathName);
  702.       CheckDlgButton (hDlg, IDD_DUMB_DECODE, DumbDecode);
  703.       CheckDlgButton (hDlg, IDD_VERBOSE_STATUS, CodingStatusVerbose);
  704.       CheckDlgButton (hDlg, IDD_EXECUTE_DECODED, ExecuteDecodedFiles);
  705.       CheckDlgButton (hDlg, IDD_SMART_FILER, UseSmartFiler);
  706.       CheckDlgButton (hDlg, IDD_KEEP_HEADER_VISIBLE, KeepArticleHeaderVisible);
  707.       EnableWindow(GetDlgItem(hDlg, IDD_KEEP_HEADER_VISIBLE), (BOOL)lParam); 
  708.       if (lParam)
  709.          SetWindowText(hDlg, "Decode Articles");
  710.       else
  711.          SetWindowText(hDlg, "Decode");
  712.  
  713.       return TRUE;
  714.       break;
  715.  
  716.     case WM_COMMAND:
  717.       switch (wParam)
  718.     {
  719.     case IDOK:
  720.       GetDlgItemText (hDlg, IDD_DECODE_PATH, DecodePathName, MAXFILENAME - 1);
  721.       RemoveTrailingWhiteSpace (DecodePathName);
  722.           len = strlen(DecodePathName);
  723.       if (len == 0)
  724.       {
  725.          MessageBox (hDlg, "Please enter a path name before continuing", "Decode Path", MB_OK);
  726.         break;                                                                                                          
  727.       }
  728.  
  729.       if (DecodePathName[len-1] == '\\')
  730.          DecodePathName[len-1] = '\0';
  731.       
  732.       if (_access(DecodePathName, 0) < 0)
  733.       {
  734.          sprintf(str, "The path %s does not exist", DecodePathName);
  735.          MessageBox (hDlg, str, "Decode Path", MB_OK|MB_ICONSTOP);
  736.         break;                                                                                                          
  737.       }
  738.  
  739.         DumbDecode = IsDlgButtonChecked (hDlg, IDD_DUMB_DECODE);
  740.          CodingStatusVerbose = IsDlgButtonChecked (hDlg, IDD_VERBOSE_STATUS);
  741.       UseSmartFiler = IsDlgButtonChecked (hDlg, IDD_SMART_FILER);
  742.       KeepArticleHeaderVisible = IsDlgButtonChecked (hDlg, IDD_KEEP_HEADER_VISIBLE);
  743.       EndDialog (hDlg, TRUE);
  744.       break;
  745.  
  746.     
  747.     case ID_BROWSE:
  748.       if (AskForFilePath (hDlg, DecodePathName, "Select Decode Path") == SUCCESS)
  749.          SetDlgItemText (hDlg, IDD_DECODE_PATH, DecodePathName);
  750.       break;
  751.  
  752.     case IDCANCEL:
  753.       EndDialog (hDlg, FALSE);
  754.       break;
  755.     
  756.     case IDD_SMART_FILER:
  757.         DialogBox(hInst, "WinvnSmartFiler", hDlg, lpfnWinVnSmartFilerDlg);
  758.         break;
  759.  
  760.     default:
  761.       return FALSE;
  762.     }
  763.       break;
  764.  
  765.     default:
  766.       return FALSE;
  767.       break;
  768.     }
  769.   return TRUE;
  770. }
  771. /*-- function WinVnAttachDlg ---------------------------------------
  772.  *
  773.  *  Dialog function to handle attachments to postings
  774.  *  (JSC)
  775.  */
  776.  
  777. BOOL FAR PASCAL 
  778. WinVnAttachDlg (hDlg, iMessage, wParam, lParam)
  779.      HWND hDlg;
  780.      unsigned iMessage;
  781.      WORD wParam;
  782.      LONG lParam;
  783. {
  784.   char temp[MAXINTERNALLINE];
  785.   extern char *GetFileExtension ();
  786.   extern BOOL isnumber();
  787.   long newLen;
  788.   register int i;
  789.   int genMIME, result;
  790.   extern char *ContentTypes[NUM_CONTENT_TYPES];
  791.     
  792.   switch (iMessage)
  793.     {
  794.     case WM_INITDIALOG:
  795.     sprintf (temp, "Attachment options for file %s", AttachFileName);
  796.     SetWindowText (hDlg, (LPSTR) temp);
  797.  
  798.     CheckRadioButton (hDlg,IDD_ATTACH_NOW, IDD_ATTACH_NEXT, AttachInNewArt?IDD_ATTACH_NEXT:IDD_ATTACH_NOW);
  799.  
  800.     // this feature is only available when posting (not when mailing)
  801.         if (!getWndEdit(WndMails, GetWindow (hDlg, GW_OWNER), MAXMAILWNDS))
  802.     {
  803.         EnableWindow (GetDlgItem (hDlg, IDD_REVIEW), TRUE);        // posting
  804.         EnableWindow (GetDlgItem (hDlg, IDD_NO_REVIEW), TRUE);
  805.     }
  806.     else
  807.     {
  808.         EnableWindow (GetDlgItem (hDlg, IDD_REVIEW), FALSE);    // mailing
  809.         EnableWindow (GetDlgItem (hDlg, IDD_NO_REVIEW), FALSE);
  810.     }
  811.             
  812.     CheckRadioButton (hDlg,IDD_REVIEW, IDD_NO_REVIEW, ReviewAttach?IDD_REVIEW:IDD_NO_REVIEW);
  813.  
  814.     SendDlgItemMessage(hDlg, IDD_ARTICLE_SPLIT_LENGTH,
  815.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "32000"));
  816.     SendDlgItemMessage(hDlg, IDD_ARTICLE_SPLIT_LENGTH,
  817.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) uitoa(MAXPOSTLENGTH, str, 10)));
  818.  
  819.     SetDlgItemText (hDlg, IDD_ARTICLE_SPLIT_LENGTH, uitoa (ArticleSplitLength, str, 10));
  820.         
  821.     SetupEncodingOptions (hDlg);
  822.  
  823.     SetDlgItemText (hDlg, IDD_SUBJECT_TEMPLATE, SubjectTemplate);
  824.  
  825.         CheckDlgButton (hDlg, IDD_GENERATE_MIME, GenerateMIME);
  826.         if (!GenerateMIME)
  827.         {
  828.         EnableWindow (GetDlgItem (hDlg, IDD_MIME_BOUNDARY), FALSE);
  829.         EnableWindow (GetDlgItem (hDlg, IDD_CONTENT_TYPE), FALSE);
  830.         EnableWindow (GetDlgItem (hDlg, IDD_MAKE_DEFAULT), FALSE);
  831.     }        
  832.         CheckDlgButton (hDlg, IDD_MIME_USAGE_SUGGESTIONS, MIMEUsageSuggestions);
  833.  
  834.     for (i = 0; i < NUM_CONTENT_TYPES; i++)
  835.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  836.             CB_ADDSTRING, 0, (LPARAM) ((LPSTR) ContentTypes[i]));
  837.  
  838.     if (_stricmp (DefaultContentType, "Other"))
  839.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  840.             CB_ADDSTRING, 0, (LPARAM) ((LPSTR) DefaultContentType));
  841.     
  842.        CheckDlgButton (hDlg, IDD_MAKE_DEFAULT, 0);
  843.  
  844.     GetFileExtension (temp, AttachFileName);
  845.     if (!_stricmp (temp, "gif"))
  846.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Image/GIF"));
  847.     else if (!_stricmp (temp, "jpg") || !_strnicmp (temp, "jpe", 3))
  848.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Image/JPEG"));
  849.     else if (!_stricmp (temp, "zip"))
  850.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Application/Zip"));
  851.     else if (!_stricmp (temp, "mpg") || !_strnicmp (temp, "mpe", 3))
  852.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Video/MPEG"));
  853.     else if (!_stricmp (temp, "avi"))                  
  854.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Video/AVI"));
  855.     else if (!_stricmp (temp, "ps"))
  856.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Application/PostScript"));
  857.     else if (!_stricmp (temp, "txt") || !_stricmp (temp, "bat") || !_stricmp (temp,"c") || !_stricmp (temp,"cpp") || !_stricmp (temp,"h"))
  858.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Text/Plain"));
  859.     else
  860.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) DefaultContentType));
  861.     
  862.     SetDlgItemText (hDlg, IDD_MIME_BOUNDARY, MIMEBoundary);
  863.  
  864.       
  865.       return TRUE;
  866.       break;
  867.  
  868.     case WM_COMMAND:
  869.       switch (wParam)
  870.     {
  871.     case ID_OK:
  872.         AttachInNewArt = IsDlgButtonChecked (hDlg, IDD_ATTACH_NEXT);
  873.       // this feature is only available when posting (not when mailing)
  874.       if (!getWndEdit(WndMails, GetWindow (hDlg, GW_OWNER), MAXMAILWNDS)) 
  875.       {
  876.           ReviewAttach = IsDlgButtonChecked (hDlg, IDD_REVIEW);
  877.           if (!ReviewAttach && CcByMail && CcAddress[0])
  878.           {
  879.               if (MessageBox (hDlg, "Cc By Mail will only operate correctly if you enable Review before posting.  Would you like enable Review before posting?", "Attachment Usage Suggestion", MB_YESNOCANCEL|MB_ICONINFORMATION) == IDYES)
  880.                  ReviewAttach = TRUE;
  881.               else 
  882.               {
  883.                   MessageBox (hDlg, "Cc By Mail disabled", "Warning", MB_OK);
  884.                   CcByMail = FALSE;
  885.               }
  886.           }
  887.       }
  888.       if (ProcessEncodingOptions (hDlg) == FAIL)
  889.           break;
  890.         
  891.       GetDlgItemText (hDlg, IDD_ARTICLE_SPLIT_LENGTH, temp, MAXINTERNALLINE);
  892.              if (!_stricmp (temp, "None"))
  893.         ArticleSplitLength = 0;
  894.       else    
  895.           if (isnumber (temp))
  896.         {
  897.             newLen = atol (temp);
  898.             if (newLen <= 0 || newLen > MAXPOSTLENGTH)
  899.             {
  900.                   sprintf (temp, "The article split length must be between 1 and %u", MAXPOSTLENGTH);
  901.                   MessageBox (hDlg, temp, "Article Split Length Error", MB_OK);
  902.                   break;                                                                                                          
  903.               }
  904.               ArticleSplitLength = (unsigned int) newLen;
  905.         }
  906.         else
  907.         {
  908.               MessageBox (hDlg, "The article split length must be a NUMBER of bytes", "Article Split Length Error", MB_OK);
  909.               break;                                                                                                          
  910.           }
  911.         
  912.       
  913.       GetDlgItemText (hDlg, IDD_SUBJECT_TEMPLATE, SubjectTemplate, MAXINTERNALLINE);
  914.  
  915.         GenerateMIME = IsDlgButtonChecked (hDlg, IDD_GENERATE_MIME);
  916.       GetDlgItemText (hDlg, IDD_MIME_BOUNDARY, MIMEBoundary, MAXBOUNDARYLEN);
  917.       // *** should check here that characters in boundary are all valid
  918.       GetDlgItemText (hDlg, IDD_CONTENT_TYPE, (LPSTR) ContentType, MAXINTERNALLINE);
  919.           if (IsDlgButtonChecked (hDlg, IDD_MAKE_DEFAULT))
  920.             strcpy (DefaultContentType, ContentType);
  921.           
  922.         MIMEUsageSuggestions = IsDlgButtonChecked (hDlg, IDD_MIME_USAGE_SUGGESTIONS);
  923.           if (MIMEUsageSuggestions)
  924.           {
  925.             if (GenerateMIME && EncodingTypeNum != CODE_NONE && EncodingTypeNum != CODE_BASE64)
  926.             {
  927.         sprintf (str, "When using %s encoding, MIME headers are not recommended.\nWould you like to deactivate MIME header generation?", EncodingType);
  928.               result = MessageBox (hDlg, str, "MIME Usage Suggestion", MB_YESNOCANCEL|MB_ICONINFORMATION);
  929.               if (result == IDYES) 
  930.                   GenerateMIME = FALSE;
  931.               else if (result == IDCANCEL)
  932.                   break;
  933.           
  934.             } 
  935.             if (!GenerateMIME && EncodingTypeNum == CODE_BASE64)
  936.             {
  937.               result = MessageBox (hDlg, "When using Base-64 encoding, MIME header generation is recommended.\nWould you like to activate MIME header generation?", 
  938.                             "MIME Usage Suggestion", MB_YESNOCANCEL|MB_ICONINFORMATION);
  939.               if (result == IDYES)    
  940.                   GenerateMIME = TRUE;
  941.               else if (result == IDCANCEL)
  942.                   break;
  943.             }
  944.           }
  945.       EndDialog (hDlg, TRUE);
  946.       break;
  947.  
  948.     case IDD_GENERATE_MIME:
  949.           genMIME = (BOOL)IsDlgButtonChecked (hDlg, IDD_GENERATE_MIME);
  950.           EnableWindow (GetDlgItem (hDlg, IDD_MIME_BOUNDARY), genMIME);
  951.       EnableWindow (GetDlgItem (hDlg, IDD_CONTENT_TYPE), genMIME);
  952.       EnableWindow (GetDlgItem (hDlg, IDD_MAKE_DEFAULT), genMIME);
  953.       break;        
  954.  
  955.     case IDCANCEL:
  956.       EndDialog (hDlg, FALSE);
  957.       break;
  958.  
  959.     default:
  960.       return FALSE;
  961.     }
  962.       break;
  963.  
  964.     default:
  965.       return FALSE;
  966.       break;
  967.     }
  968.   return TRUE;
  969. }
  970. /*-- function WinVnEncodeDlg ---------------------------------------
  971.  *
  972.  *  Dialog function to handle encoding to a file
  973.  *  Very similar to WinVnAttachDlg
  974.  *  (JSC)
  975.  */
  976.  
  977. BOOL FAR PASCAL 
  978. WinVnEncodeDlg (hDlg, iMessage, wParam, lParam)
  979.      HWND hDlg;
  980.      unsigned iMessage;
  981.      WORD wParam;
  982.      LONG lParam;
  983. {
  984.   char temp[MAXINTERNALLINE];
  985.   
  986.   switch (iMessage)
  987.     {
  988.     case WM_INITDIALOG:
  989.     sprintf (temp, "Encoding options for file %s", AttachFileName);
  990.     SetWindowText (hDlg, (LPSTR) temp);
  991.  
  992.         SetDlgItemText (hDlg, IDD_FILENAME, AttachFileName);
  993.     SetupEncodingOptions (hDlg);
  994.     return TRUE;
  995.     break;
  996.  
  997.     case WM_COMMAND:
  998.       switch (wParam)
  999.     {
  1000.     case ID_OK:
  1001.       GetDlgItemText (hDlg, IDD_FILENAME, AttachFileName, MAXFILENAME - 1);
  1002.       if (strlen (AttachFileName) == 0)
  1003.           {
  1004.           MessageBox (hDlg, "Please enter a filename to encode", "Filename error", MB_OK);
  1005.           break;                                                                                                          
  1006.           }
  1007.           
  1008.       if (_access(AttachFileName, 0) < 0)
  1009.       {
  1010.          sprintf(str, "The file %s does not exist", AttachFileName);
  1011.          MessageBox (hDlg, str, "Filename error", MB_OK|MB_ICONSTOP);
  1012.         break;                                                                                                          
  1013.       }
  1014.  
  1015.       if (ProcessEncodingOptions (hDlg) == FAIL)
  1016.           break;
  1017.  
  1018.       EndDialog (hDlg, TRUE);
  1019.       break;
  1020.  
  1021.     case IDCANCEL:
  1022.       EndDialog (hDlg, FALSE);
  1023.       break;
  1024.  
  1025.     case ID_BROWSE:
  1026.       if (AskForExistingFileName (hDlg, AttachFileName, "Open file to be encoded") == SUCCESS)
  1027.          SetDlgItemText (hDlg, IDD_FILENAME, AttachFileName);
  1028.       break;
  1029.  
  1030.     default:
  1031.       return FALSE;
  1032.     }
  1033.       break;
  1034.  
  1035.     default:
  1036.       return FALSE;
  1037.       break;
  1038.     }
  1039.   return TRUE;
  1040. }
  1041.  
  1042. /*----------------------------------------------------------------------
  1043.  * Encoding options functions for use by two dialogs
  1044.  * wvattachdlg and wvencodedlg
  1045.  * (JSC)
  1046.  */
  1047. void
  1048. SetupEncodingOptions (HWND hDlg)
  1049. {
  1050.   register int i;
  1051.   extern char *EncodingTypes[NUM_ENCODING_TYPES];
  1052.  
  1053.     // This combo box is NOSORT, so entries can be indexed in order they 
  1054.     // added here. But BE CAREFUL!
  1055.     for (i = 0; i < NUM_ENCODING_TYPES; i++)
  1056.         SendDlgItemMessage(hDlg, IDD_CODING_TYPE,    
  1057.             CB_ADDSTRING, 0, (LPARAM) ((LPSTR) EncodingTypes[i]));
  1058.  
  1059.     if (EncodingTypeToNum (EncodingType) == CODE_UNKNOWN)
  1060.         strcpy (EncodingType, "None");
  1061.  
  1062.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) EncodingType));
  1063.  
  1064.     if (UserCodingTable[0] != '\0')
  1065.         SetDlgItemText (hDlg, IDD_CUSTOM_TABLE, UserCodingTable);
  1066. }
  1067.  
  1068. BOOL
  1069. ProcessEncodingOptions (HWND hDlg)
  1070. {
  1071.     char temp[MAXINTERNALLINE];
  1072.     int select, x;
  1073.     char dummyMap[128];
  1074.     
  1075.     select = (int)SendDlgItemMessage(hDlg, IDD_CODING_TYPE, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
  1076.     if (select != CB_ERR)
  1077.         SendDlgItemMessage(hDlg, IDD_CODING_TYPE,
  1078.                    CB_GETLBTEXT, (WPARAM) select, (LPARAM) ((LPSTR) temp));
  1079.  
  1080.            if (!_stricmp (temp, "Custom"))
  1081.         if (GetDlgItemText (hDlg, IDD_CUSTOM_TABLE, UserCodingTable, CODINGTABLESIZE+1))
  1082.           {
  1083.             if (strlen(UserCodingTable) != CODINGTABLESIZE)
  1084.               {
  1085.                   MessageBox (hDlg, "Invalid encoding table.  The table must contain 64 characters.", "Custom Encoding Error", MB_OK);
  1086.                   return (FAIL);
  1087.               }
  1088.               if ((x = CreateCodingMap(dummyMap, UserCodingTable)) != -1)
  1089.               {
  1090.                   sprintf (temp, "Invalid encoding table.  The table must have no duplicate entries (duplicate is %c).", x);
  1091.                   MessageBox (hDlg, temp, "Custom Encoding Error", ID_OK);
  1092.                   return (FAIL);
  1093.               }
  1094.           } else {
  1095.               MessageBox (hDlg, "To use a custom encoding, you must enter an encoding table", "Custom Encoding Error", MB_OK);
  1096.             return (FAIL);
  1097.          }
  1098.     
  1099.     strcpy (EncodingType, temp);
  1100.     EncodingTypeNum = EncodingTypeToNum (EncodingType);
  1101.               
  1102.       return (OK);
  1103. }
  1104.  
  1105. /*-- function WinVnSigFileDlg ---------------------------------------
  1106.  *
  1107.  *  Dialog function to handle signature files
  1108.  *  (JSC 1/8/94)
  1109.  */
  1110.  
  1111. BOOL FAR PASCAL 
  1112. WinVnSigFileDlg (hDlg, iMessage, wParam, lParam)
  1113.      HWND hDlg;
  1114.      unsigned iMessage;
  1115.      WORD wParam;
  1116.      LONG lParam;
  1117. {
  1118.   static int MyEnable;
  1119.  
  1120.   switch (iMessage)
  1121.     {
  1122.     MyEnable = EnableSig;
  1123.  
  1124.     case WM_INITDIALOG:
  1125.       CheckDlgButton (hDlg, IDD_ENABLE_SIG, EnableSig);
  1126.       SetDlgItemText (hDlg, IDD_FILENAME, SigFileName);
  1127.       return TRUE;
  1128.       break;
  1129.  
  1130.     case WM_COMMAND:
  1131.       switch (wParam)
  1132.     {
  1133.     case IDOK:
  1134.       GetDlgItemText (hDlg, IDD_FILENAME, SigFileName, MAXFILENAME - 1);
  1135.  
  1136.           ResetTextBlock (Signature);
  1137.           if (strlen (SigFileName) == 0)
  1138.           {
  1139.             EnableSig = FALSE;
  1140.             EndDialog (hDlg, TRUE);
  1141.             break;
  1142.           }
  1143.  
  1144.       EnableSig = MyEnable;
  1145.       if (ReadFileToTextBlock (hDlg, Signature, SigFileName, ADD_PLAIN) == FAIL)
  1146.         break;
  1147.  
  1148.           if (Signature->numLines > BIG_SIG_FILE)
  1149.       {
  1150.           sprintf (str, "Do you really want a %lu line signature?!?", Signature->numLines);
  1151.           if (MessageBox (hDlg, str, "BIG Signature!", MB_YESNO|MB_ICONQUESTION) == IDNO)
  1152.           {
  1153.           ResetTextBlock (Signature);
  1154.           break;
  1155.         }
  1156.       }          
  1157.       EndDialog (hDlg, TRUE);
  1158.       break;
  1159.  
  1160.     case ID_BROWSE:
  1161.       if (AskForExistingFileName (hDlg, SigFileName, "Select Signature File") == SUCCESS)
  1162.         SetDlgItemText (hDlg, IDD_FILENAME, SigFileName);
  1163.       break;
  1164.  
  1165.     case IDCANCEL:
  1166.       EndDialog (hDlg, FALSE);
  1167.       break;
  1168.  
  1169.     case IDD_ENABLE_SIG:
  1170.       MyEnable = !MyEnable;
  1171.       CheckDlgButton (hDlg, IDD_ENABLE_SIG, MyEnable);
  1172.       break;
  1173.  
  1174.     default:
  1175.       return FALSE;
  1176.     }
  1177.       break;
  1178.  
  1179.     default:
  1180.       return FALSE;
  1181.       break;
  1182.     }
  1183.   return TRUE;
  1184. }
  1185.  
  1186. /*-- function WinVnExitDlg---------------------------------------
  1187.  *
  1188.  *  Dialog function to handle exit from WinVn
  1189.  *  Sets globals SaveNewsrc and SaveConfig - leaves actual saving up to caller
  1190.  *  (JSC 1/8/94)
  1191.  */
  1192.  
  1193. BOOL FAR PASCAL 
  1194. WinVnExitDlg (hDlg, iMessage, wParam, lParam)
  1195.      HWND hDlg;
  1196.      unsigned iMessage;
  1197.      WORD wParam;
  1198.      LONG lParam;
  1199. {
  1200.   switch (iMessage)
  1201.     {
  1202.     case WM_INITDIALOG:
  1203.       CheckDlgButton (hDlg, IDD_SAVE_NEWSRC, 1);
  1204.       CheckDlgButton (hDlg, IDD_SAVE_CONFIG, 1);
  1205.       return TRUE;
  1206.       break;
  1207.  
  1208.     case WM_COMMAND:
  1209.       switch (wParam)
  1210.     {
  1211.     case IDOK:
  1212.       SaveNewsrc = IsDlgButtonChecked (hDlg, IDD_SAVE_NEWSRC);
  1213.       SaveConfig = IsDlgButtonChecked (hDlg, IDD_SAVE_CONFIG);
  1214.       EndDialog (hDlg, TRUE);
  1215.       break;
  1216.  
  1217.     case IDCANCEL:
  1218.       EndDialog (hDlg, FALSE);
  1219.       break;
  1220.  
  1221.     default:
  1222.       return FALSE;
  1223.     }
  1224.       break;
  1225.  
  1226.     default:
  1227.       return FALSE;
  1228.       break;
  1229.     }
  1230.   return TRUE;
  1231. }
  1232.  
  1233. /*-- function WinVnFindDlg ---------------------------------------
  1234.  *
  1235.  *  Dialog function to handle Search dialog box.
  1236.  */
  1237.  
  1238. BOOL FAR PASCAL 
  1239. WinVnFindDlg (hDlg, iMessage, wParam, lParam)
  1240.      HWND hDlg;
  1241.      unsigned iMessage;
  1242.      WORD wParam;
  1243.      LONG lParam;
  1244. {
  1245.   static int MyAppend;
  1246.  
  1247.   switch (iMessage)
  1248.     {
  1249.  
  1250.     case WM_INITDIALOG:
  1251.       SetDlgItemText (hDlg, IDD_SEARCH_STRING, FindDoc->SearchStr);
  1252.       return TRUE;
  1253.       break;
  1254.  
  1255.     case WM_COMMAND:
  1256.       switch (wParam)
  1257.    {
  1258.    case IDOK:
  1259.      GetDlgItemText (hDlg, IDD_SEARCH_STRING, FindDoc->SearchStr, MAXFINDSTRING - 1);
  1260.  
  1261.      EndDialog (hDlg, TRUE);
  1262.      break;
  1263.  
  1264.    case IDCANCEL:
  1265.      EndDialog (hDlg, FALSE);
  1266.      break;
  1267.  
  1268.    default:
  1269.      return FALSE;
  1270.    }
  1271.       break;
  1272.  
  1273.     default:
  1274.       return FALSE;
  1275.       break;
  1276.     }
  1277.   return TRUE;
  1278. }
  1279.  
  1280. /*-- function WinVnGenericDlg ---------------------------------------
  1281.  *
  1282.  *  Dialog function to query the user for a posting's subject
  1283.  */
  1284.  
  1285. BOOL FAR PASCAL 
  1286. WinVnGenericDlg (hDlg, iMessage, wParam, lParam)
  1287.      HWND hDlg;
  1288.      unsigned iMessage;
  1289.      WORD wParam;
  1290.      LONG lParam;
  1291. {
  1292.   switch (iMessage)
  1293.     {
  1294.  
  1295.     case WM_INITDIALOG:
  1296.       /* set the prompt, DialogBoxParam passes in lParam */
  1297.       SetDlgItemText (hDlg, IDD_SUBJECT_PROMPT, (char far *) lParam);
  1298.       SetDlgItemText (hDlg, IDD_SUBJECT_STRING, DialogString);
  1299.       return TRUE;
  1300.       break;
  1301.  
  1302.     case WM_COMMAND:
  1303.       switch (wParam)
  1304.    {
  1305.    case IDOK:
  1306.      GetDlgItemText (hDlg, IDD_SUBJECT_STRING, DialogString, 
  1307.                      MAXDIALOGSTRING - 1);
  1308.  
  1309.      EndDialog (hDlg, TRUE);
  1310.      break;
  1311.  
  1312.    case IDCANCEL:
  1313.      EndDialog (hDlg, FALSE);
  1314.      break;
  1315.  
  1316.    default:
  1317.      return FALSE;
  1318.    }
  1319.       break;
  1320.  
  1321.     default:
  1322.       return FALSE;
  1323.       break;
  1324.     }
  1325.   return TRUE;
  1326. }
  1327.  
  1328. /*-- function WinVnSubjectDlg ---------------------------------------
  1329.  *
  1330.  *  Dialog function to query the user for a posting's subject
  1331.  */
  1332.  
  1333. BOOL FAR PASCAL 
  1334. WinVnSubjectDlg (hDlg, iMessage, wParam, lParam)
  1335.      HWND hDlg;
  1336.      unsigned iMessage;
  1337.      WORD wParam;
  1338.      LONG lParam;
  1339. {
  1340.   BOOL useCC;
  1341.   
  1342.   switch (iMessage)
  1343.     {
  1344.     case WM_INITDIALOG:
  1345.       /* disable cc by mail option if this already is a mail composition, 
  1346.          or if mail is disabled, or if mail is not SMTP */
  1347.       if (lParam && MailCtrl.enableMail == MF_ENABLED && MailCtrl.MailType == MT_SMTP) {
  1348.          useCC = CcByMail;
  1349.       } else {
  1350.          EnableWindow (GetDlgItem (hDlg, IDD_CC_BY_MAIL), FALSE);
  1351.          useCC = FALSE;
  1352.       }
  1353.          
  1354.       CheckDlgButton (hDlg, IDD_CC_BY_MAIL, useCC);
  1355.       EnableWindow (GetDlgItem (hDlg, IDD_CC_ADDRESS), useCC);
  1356.       EnableWindow (GetDlgItem (hDlg, ID_BROWSE), useCC);
  1357.       SetDlgItemText (hDlg, IDD_CC_ADDRESS, CcAddress);
  1358.  
  1359.       SetDlgItemText (hDlg, IDD_SUBJECT_STRING, DialogString);
  1360.       if (ReplyTo[0] == '\0')
  1361.          SetDlgItemText (hDlg, IDD_REPLY_TO, MailAddress);
  1362.       else
  1363.          SetDlgItemText (hDlg, IDD_REPLY_TO, ReplyTo);
  1364.  
  1365.  
  1366.       return TRUE;
  1367.       break;
  1368.  
  1369.     case WM_COMMAND:
  1370.       switch (wParam)
  1371.    {
  1372.  
  1373.    case ID_BROWSE:
  1374.     GetDlgItemText (hDlg, IDD_CC_ADDRESS, DialogString, MAXDIALOGSTRING-1); /* set default in mail address box */
  1375.     if (DialogBox (hInst, "WinVnMail", hWndConf, lpfnWinVnMailDlg))
  1376.       SetDlgItemText (hDlg, IDD_CC_ADDRESS, DialogString);
  1377.     break;
  1378.       
  1379.      
  1380.    case IDD_CC_BY_MAIL:
  1381.      CcByMail = IsDlgButtonChecked (hDlg, IDD_CC_BY_MAIL);
  1382.      EnableWindow (GetDlgItem (hDlg, IDD_CC_ADDRESS), CcByMail);
  1383.      EnableWindow (GetDlgItem (hDlg, ID_BROWSE), CcByMail);
  1384.      break;
  1385.  
  1386.    case IDOK:
  1387.      GetDlgItemText (hDlg, IDD_SUBJECT_STRING, DialogString, 
  1388.                      MAXDIALOGSTRING - 1);
  1389.      GetDlgItemText (hDlg, IDD_REPLY_TO, str, MAXDIALOGSTRING - 1);
  1390.      if (str[0] == '\0' || !strcmp (str, MailAddress))
  1391.         ReplyTo[0] = '\0';
  1392.      else      
  1393.         strcpy (ReplyTo, str);
  1394.  
  1395.      CcByMail = IsDlgButtonChecked (hDlg, IDD_CC_BY_MAIL);
  1396.      if (CcByMail)
  1397.        GetDlgItemText (hDlg, IDD_CC_ADDRESS, CcAddress, MAXDIALOGSTRING-1);
  1398.  
  1399.      EndDialog (hDlg, TRUE);
  1400.      break;
  1401.  
  1402.    case IDCANCEL:
  1403.      EndDialog (hDlg, FALSE);
  1404.      break;
  1405.  
  1406.    default:
  1407.      return FALSE;
  1408.    }
  1409.       break;
  1410.  
  1411.     default:
  1412.       return FALSE;
  1413.       break;
  1414.     }
  1415.   return TRUE;
  1416. }
  1417. /*-- function WinVnDoListDlg ---------------------------------------
  1418.  *
  1419.  *  Dialog function to ask whether we should check for new
  1420.  *  newsgroups.
  1421.  */
  1422.  
  1423. BOOL FAR PASCAL 
  1424. WinVnDoListDlg (hDlg, iMessage, wParam, lParam)
  1425.      HWND hDlg;
  1426.      unsigned iMessage;
  1427.      WORD wParam;
  1428.      LONG lParam;
  1429. {
  1430.  
  1431.   switch (iMessage)
  1432.     {
  1433.  
  1434.     case WM_COMMAND:
  1435.       switch (wParam)
  1436.    {
  1437.    case IDOK:
  1438.  
  1439.      EndDialog (hDlg, TRUE);
  1440.      break;
  1441.  
  1442.    case IDCANCEL:
  1443.  
  1444.      EndDialog (hDlg, FALSE);
  1445.      break;
  1446.  
  1447.    default:
  1448.      return FALSE;
  1449.    }
  1450.       break;
  1451.  
  1452.     default:
  1453.       return FALSE;
  1454.       break;
  1455.     }
  1456.   return TRUE;
  1457. }
  1458.  
  1459.  
  1460. /*--- Function WinVnPersonalInfoDlg ----------------------------------
  1461.  *
  1462.  *  Dialog function to obtain personal configuration info
  1463.  *  (Name, email address, etc.) from the user.
  1464.  */
  1465.  
  1466. BOOL FAR PASCAL 
  1467. WinVnPersonalInfoDlg (hDlg, iMessage, wParam, lParam)
  1468.      HWND hDlg;
  1469.      unsigned iMessage;
  1470.      WORD wParam;
  1471.      LONG lParam;
  1472. {
  1473. #define MAXSTR  32
  1474.  
  1475.   int write_ini = FALSE;
  1476.   int dialog_val;
  1477.  
  1478.   switch (iMessage)
  1479.     {
  1480.  
  1481.     case WM_INITDIALOG:
  1482.  
  1483.       SetDlgItemText (hDlg, ID_CONFIG_EMAIL, MailAddress);
  1484.       SetDlgItemText (hDlg, ID_CONFIG_NAME, UserName);
  1485.       SetDlgItemText (hDlg, ID_CONFIG_ORG, Organization);
  1486.       return TRUE;
  1487.       break;
  1488.  
  1489.     case WM_COMMAND:
  1490.       switch (wParam)
  1491.    {
  1492.    case ID_OK_SAVE:
  1493.      write_ini = TRUE;
  1494.    case IDOK:
  1495.      GetDlgItemText (hDlg, ID_CONFIG_NAME, UserName, MAILLEN - 1);
  1496.      GetDlgItemText (hDlg, ID_CONFIG_EMAIL, MailAddress, MAILLEN - 1);
  1497.      GetDlgItemText (hDlg, ID_CONFIG_ORG, Organization, MAILLEN - 1);
  1498.  
  1499. /*   if (write_ini)          (JSC - Now save on exit of app)
  1500.        {
  1501.          WritePrivateProfileString (szAppName, "UserName", UserName, szAppProFile);
  1502.          WritePrivateProfileString (szAppName, "MailAddress", MailAddress, szAppProFile);
  1503.          WritePrivateProfileString (szAppName, "Organization", Organization, szAppProFile);
  1504.        }
  1505. */   dialog_val = TRUE;
  1506.      goto endit;
  1507.      break;
  1508.  
  1509.    case IDCANCEL:
  1510.      dialog_val = FALSE;
  1511.    endit:;
  1512.      EndDialog (hDlg, dialog_val);
  1513.      break;
  1514.  
  1515.    default:
  1516.      return FALSE;
  1517.    }
  1518.       break;
  1519.  
  1520.     default:
  1521.       return FALSE;
  1522.       break;
  1523.     }
  1524.   return TRUE;
  1525. }
  1526.  
  1527.  
  1528.  
  1529. /*--- Function WinVnMiscDlg ---------------------------------------------
  1530.  *
  1531.  *  Dialog function to obtain miscellaneous configuration info
  1532.  *  (whether we should open a new window for each group, etc.)
  1533.  *  from the user.
  1534.  */
  1535.  
  1536. BOOL FAR PASCAL 
  1537. WinVnMiscDlg (hDlg, iMessage, wParam, lParam)
  1538.      HWND hDlg;
  1539.      unsigned iMessage;
  1540.      WORD wParam;
  1541.      LONG lParam;
  1542. {
  1543.   int write_ini = FALSE;
  1544.   int dialog_val;
  1545.   int item;
  1546.   int temp;
  1547.   char threshold[5];
  1548.   static int MyFullSubject;
  1549.  
  1550.   switch (iMessage)
  1551.     {
  1552.  
  1553.     case WM_INITDIALOG:
  1554.       CheckRadioButton (hDlg, ID_DOLIST_BASE, ID_DOLIST_ASK, DoList + ID_DOLIST_BASE);
  1555.       CheckDlgButton (hDlg, ID_CONFIG_APPEND, SaveArtAppend);
  1556.       CheckDlgButton (hDlg, ID_CONFIG_NEW_WND_GROUP, ViewNew);
  1557.       CheckDlgButton (hDlg, ID_CONFIG_NEW_WND_ARTICLE, NewArticleWindow);
  1558. /*    CheckDlgButton (hDlg, ID_CONFIG_ARTICLE_FIXED_FONT, ArticleFixedFont); */
  1559.       CheckDlgButton (hDlg, ID_CONFIG_FULLNAMEFROM, FullNameFrom);
  1560.       CheckDlgButton (hDlg, ID_CONFIG_THREADS, threadp);  
  1561.       CheckDlgButton (hDlg, ID_CONFIG_THREADS_FULL_SUBJECT, ThreadFullSubject);
  1562.       CheckDlgButton (hDlg, ID_CONFIG_SHOWUNSUB, ShowUnsubscribed);
  1563.       CheckDlgButton (hDlg, ID_CONFIG_CONFIRM_BATCH, ConfirmBatchOps);
  1564.       CheckDlgButton (hDlg, ID_CONFIG_CONFIRM_EXIT, ConfirmExit);
  1565.       CheckDlgButton (hDlg, ID_CONFIG_CONFIRM_REPLY_TO, ConfirmReplyTo);
  1566.       CheckDlgButton (hDlg, ID_CONFIG_GROUP_MULTI_SELECT, GroupMultiSelect);
  1567.       CheckDlgButton (hDlg, ID_CONFIG_CONNECT_AT_START, ConnectAtStartup);
  1568.       CheckDlgButton (hDlg, IDD_EXECUTE_DECODED, ExecuteDecodedFiles);
  1569.       CheckDlgButton (hDlg, ID_CONFIG_SHOWUNREADONLY, ShowUnreadOnly);
  1570.       MyFullSubject = ThreadFullSubject;
  1571.       
  1572.       sprintf (threshold, "%d", article_threshold);
  1573.       SetDlgItemText (hDlg, IDD_ART_THRESHOLD, threshold);
  1574.  
  1575.       return TRUE;
  1576.       break;
  1577.  
  1578.     case WM_COMMAND:
  1579.       switch (wParam)
  1580.    {
  1581.    case ID_OK_SAVE:
  1582.      write_ini = TRUE;
  1583.    case IDOK:
  1584.      SaveArtAppend = (IsDlgButtonChecked (hDlg, ID_CONFIG_APPEND) != 0);
  1585.      ViewNew = (IsDlgButtonChecked (hDlg, ID_CONFIG_NEW_WND_GROUP) != 0);
  1586.      NewArticleWindow = (IsDlgButtonChecked (hDlg, ID_CONFIG_NEW_WND_ARTICLE) != 0);
  1587.      FullNameFrom = (IsDlgButtonChecked (hDlg, ID_CONFIG_FULLNAMEFROM) != 0); 
  1588.      ConfirmBatchOps = (IsDlgButtonChecked (hDlg, ID_CONFIG_CONFIRM_BATCH) != 0); 
  1589.      ConfirmExit = (IsDlgButtonChecked (hDlg, ID_CONFIG_CONFIRM_EXIT) != 0); 
  1590.      ConfirmReplyTo = (IsDlgButtonChecked (hDlg, ID_CONFIG_CONFIRM_REPLY_TO) != 0); 
  1591.      ThreadFullSubject = (IsDlgButtonChecked (hDlg, ID_CONFIG_THREADS_FULL_SUBJECT) != 0);
  1592.      GroupMultiSelect = (IsDlgButtonChecked (hDlg, ID_CONFIG_GROUP_MULTI_SELECT) != 0);
  1593.      ConnectAtStartup = (IsDlgButtonChecked (hDlg, ID_CONFIG_CONNECT_AT_START) != 0);
  1594.      ExecuteDecodedFiles = (IsDlgButtonChecked (hDlg, IDD_EXECUTE_DECODED) != 0);
  1595.      ShowUnreadOnly   = (IsDlgButtonChecked (hDlg, ID_CONFIG_SHOWUNREADONLY) != 0);
  1596.      if (ThreadFullSubject != MyFullSubject)
  1597.        RefreshGroupWnds();
  1598.  
  1599. /*   ArticleFixedFont = (IsDlgButtonChecked (hDlg, ID_CONFIG_ARTICLE_FIXED_FONT) != 0);
  1600.      if (ArticleFixedFont != MyArticleFixedFont) {
  1601.        InitArticleFonts();
  1602.        RefreshArticleWnds();
  1603.      }
  1604. */     
  1605.      /* If the user has changed the ShowUnsubscribed option, we must
  1606.       * recompute which lines are active and redisplay.  
  1607.       * Reset the window to the top to make sure that everything
  1608.       * will display OK.
  1609.       * There is some question in my mind whether this code will
  1610.       * work OK if the first screen's worth of groups are unsubscribed,
  1611.       * but it *should* work.
  1612.       */
  1613.      temp = (IsDlgButtonChecked (hDlg,ID_CONFIG_SHOWUNSUB) != 0);
  1614.      if(temp != ShowUnsubscribed) {
  1615.       ShowUnsubscribed = temp;
  1616.       NetDoc.LongestLine = 0;
  1617.       SetGroupActiveLines();
  1618.       ScreenToTop(&NetDoc);              
  1619.       InvalidateRect(hWndConf,NULL,FALSE);
  1620.      }
  1621.      
  1622.      threadp = (IsDlgButtonChecked (hDlg, ID_CONFIG_THREADS) != 0);
  1623.      GetDlgItemText(hDlg,IDD_ART_THRESHOLD,threshold,5);
  1624.  
  1625.      /* 0 or a bogus value means they don't want a threshold */
  1626.      article_threshold = atoi (threshold);
  1627.      if (!article_threshold)
  1628.        article_threshold = INT_MAX;
  1629.  
  1630.      for (item = ID_DOLIST_BASE; item <= ID_DOLIST_ASK; item++)
  1631.        {
  1632.          if (IsDlgButtonChecked (hDlg, item))
  1633.          {
  1634.            DoList = item - ID_DOLIST_BASE;
  1635.          }
  1636.        }
  1637.  
  1638. /*  if (write_ini)         (JSC - Now save on exit of app)
  1639.     {
  1640.       WritePrivateProfileInt
  1641.     (szAppName, "SaveArtAppend", SaveArtAppend, szAppProFile);
  1642.       WritePrivateProfileInt
  1643.     (szAppName, "NewWndGroup", ViewNew, szAppProFile);
  1644.       WritePrivateProfileInt
  1645.     (szAppName, "NewWndArticle", NewArticleWindow, szAppProFile);
  1646.       WritePrivateProfileInt
  1647.     (szAppName, "DoList", DoList, szAppProFile);
  1648.       WritePrivateProfileInt
  1649.     (szAppName, "ArticleFixedFont", ArticleFixedFont, szAppProFile);
  1650.       WritePrivateProfileInt
  1651.     (szAppName, "ArticleThreshold", article_threshold, szAppProFile);
  1652.       WritePrivateProfileInt
  1653.     (szAppName, "FullNameFrom", FullNameFrom, szAppProFile);
  1654.       WritePrivateProfileInt
  1655.         (szAppName, "EnableThreading", threadp, szAppProFile);
  1656.       WritePrivateProfileInt
  1657.         (szAppName, "ShowUnsubscribed", ShowUnsubscribed, szAppProFile);
  1658.     }
  1659. */  dialog_val = TRUE;
  1660.     goto endit;
  1661.     break;
  1662.  
  1663.    case IDCANCEL:
  1664.      dialog_val = FALSE;
  1665.    endit:;
  1666.      EndDialog (hDlg, dialog_val);
  1667.      break;
  1668.  
  1669.    default:
  1670.      return FALSE;
  1671.    }
  1672.       break;
  1673.  
  1674.     default:
  1675.       return FALSE;
  1676.       break;
  1677.     }
  1678.   return TRUE;
  1679.  
  1680. }
  1681.  
  1682. /*-- function WinVnThresholdDlg ---------------------------------------
  1683.  *
  1684.  *  Dialog function to ask how many article headers we
  1685.  *  want to retrieve.
  1686.  */
  1687.  
  1688. BOOL FAR PASCAL 
  1689. WinVnThresholdDlg (hDlg, iMessage, wParam, lParam)
  1690.      HWND hDlg;
  1691.      unsigned iMessage;
  1692.      WORD wParam;
  1693.      LONG lParam;
  1694. {
  1695.  
  1696.   char manual[6];
  1697.  
  1698.   switch (iMessage)
  1699.     {
  1700.  
  1701.     case WM_INITDIALOG:
  1702.         sprintf (str, "%u articles in group", arts_to_retrieve);
  1703.         SetWindowText(hDlg, (LPCSTR)str);
  1704.     break;
  1705.     case WM_COMMAND:
  1706.       switch (wParam)
  1707.    {
  1708.    case ID_OK:
  1709.      GetDlgItemText (hDlg, IDD_ARTS_TO_GRAB, manual, 6);
  1710.      arts_to_retrieve = (unsigned int) atoi (manual);
  1711.      if (arts_to_retrieve > 0)
  1712.        EndDialog (hDlg, TRUE);
  1713.      break;
  1714.  
  1715.    case ID_CANCEL:
  1716.      EndDialog (hDlg, FALSE);
  1717.      break;
  1718.      
  1719.    case ID_100_ARTS:
  1720.  
  1721.      arts_to_retrieve = 100;
  1722.      EndDialog (hDlg, TRUE);
  1723.      break;
  1724.  
  1725.    case ID_250_ARTS:
  1726.  
  1727.      arts_to_retrieve = 250;
  1728.      EndDialog (hDlg, TRUE);
  1729.      break;
  1730.  
  1731.    case ID_500_ARTS:
  1732.  
  1733.      arts_to_retrieve = 500;
  1734.      EndDialog (hDlg, TRUE);
  1735.      break;
  1736.  
  1737.    case ID_THRESHOLD_ALL:
  1738.      arts_to_retrieve = -1;
  1739.      EndDialog (hDlg, TRUE);
  1740.      break;
  1741.      
  1742.    case ID_THRESHOLD_UNREAD:
  1743.      arts_to_retrieve = -2;
  1744.      EndDialog (hDlg, TRUE);
  1745.      break;
  1746.  
  1747.    default:
  1748.      return FALSE;
  1749.    }
  1750.       break;
  1751.  
  1752.     default:
  1753.       return FALSE;
  1754.       break;
  1755.     }
  1756.   return TRUE;
  1757. }
  1758.  
  1759.  
  1760. /*--- Function WinVnAppearanceDlg ----------------------------------
  1761.  *
  1762.  *  Dialog function to obtain window appearance configuration info
  1763.  *  (font, color, etc.)
  1764.  *  from the user.
  1765.  */
  1766.  
  1767. BOOL FAR PASCAL 
  1768. WinVnAppearanceDlg (hDlg, iMessage, wParam, lParam)
  1769.      HWND hDlg;
  1770.      unsigned iMessage;
  1771.      WORD wParam;
  1772.      LONG lParam;
  1773. {
  1774.   return (TRUE);
  1775. }
  1776.  
  1777. BOOL FAR PASCAL
  1778. WinVnLogOptDlg (hDlg, iMessage, wParam, lParam)
  1779.      HWND hDlg;
  1780.      unsigned iMessage;
  1781.      WORD wParam;
  1782.      LONG lParam;
  1783. {
  1784.   int write_ini = FALSE;
  1785.   static int SaveMailLog, SavePostLog ;
  1786.   char fileName[MAXFILENAME];
  1787.  
  1788.   switch (iMessage)
  1789.     {
  1790.  
  1791.     case WM_INITDIALOG:
  1792.       SaveMailLog = MailLog ;
  1793.       SavePostLog = PostLog ;
  1794.       CheckDlgButton (hDlg, IDD_MAILLOG, SaveMailLog);
  1795.       CheckDlgButton (hDlg, IDD_POSTLOG, SavePostLog);
  1796.       SetDlgItemText (hDlg, IDD_MAILNAME, MailLogFile);
  1797.       SetDlgItemText (hDlg, IDD_POSTNAME, PostLogFile);
  1798. //   EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  1799.       EnableWindow(GetDlgItem(hDlg,IDD_POSTNAME),SavePostLog);
  1800.   /* mail logging only works for non mapi at present */
  1801.      EnableWindow(GetDlgItem(hDlg,IDD_MAILLOG),(MailCtrl.MailType != MT_MAPI));
  1802.      EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),
  1803.        (MailCtrl.MailType != MT_MAPI)&&SaveMailLog);
  1804.  
  1805.       return TRUE;
  1806.       break;
  1807.  
  1808.     case WM_COMMAND:
  1809.       switch (wParam)
  1810.    {
  1811.    case ID_OK_SAVE:
  1812.      write_ini = TRUE;
  1813.    case IDOK:
  1814.      GetDlgItemText (hDlg,  IDD_MAILNAME, MailLogFile, MAXFILENAME - 1);
  1815.      GetDlgItemText (hDlg,  IDD_POSTNAME, PostLogFile, MAXFILENAME - 1);
  1816.  
  1817.      MailLog = SaveMailLog;
  1818.           PostLog = SavePostLog;
  1819. /*        Should we check sensibility of files before exiting ?
  1820.      if (!MRRWriteDocument (ActiveArticleDoc, sizeof (TypText), SaveArtFileName, SaveArtAppend))
  1821.        {
  1822.          MessageBox (hWndConf, "Could not write to file", "Problems saving file", MB_OK | MB_ICONEXCLAMATION);
  1823.        }
  1824. */
  1825. /*  if (write_ini)    (JSC - now save on exit of app)
  1826.     {
  1827.       WritePrivateProfileString
  1828.     (szAppName, "MailLogFile", MailLogFile, szAppProFile);
  1829.       WritePrivateProfileString
  1830.     (szAppName, "PostLogFile", PostLogFile, szAppProFile);
  1831.       WritePrivateProfileInt (szAppName, "MailLog",
  1832.          MailLog, szAppProFile);
  1833.       WritePrivateProfileInt (szAppName, "PostLog",
  1834.          PostLog, szAppProFile);
  1835.        }
  1836. */
  1837.       EndDialog (hDlg, TRUE);
  1838.       break;
  1839.  
  1840.     case IDCANCEL:
  1841.       EndDialog (hDlg, FALSE);
  1842.       break;
  1843.  
  1844.    case ID_BROWSEPOST:
  1845.      fileName[0]='\0';
  1846.      if (AskForNewFileName (hDlg, fileName, "", FALSE) == SUCCESS)
  1847.        SetDlgItemText (hDlg, IDD_POSTNAME, fileName);
  1848.      break;
  1849.  
  1850.    case ID_BROWSEMAIL:
  1851.      fileName[0]='\0';
  1852.      if (AskForNewFileName (hDlg, fileName, "", FALSE) == SUCCESS)
  1853.        SetDlgItemText (hDlg, IDD_MAILNAME, fileName);
  1854.      break;
  1855.  
  1856.     case IDD_MAILLOG:
  1857.       SaveMailLog = !SaveMailLog;
  1858.       CheckDlgButton (hDlg, IDD_MAILLOG, SaveMailLog);
  1859.       EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  1860.       break;
  1861.     case IDD_POSTLOG:
  1862.       SavePostLog = !SavePostLog;
  1863.       CheckDlgButton (hDlg, IDD_POSTLOG, SavePostLog);
  1864.       EnableWindow(GetDlgItem(hDlg,IDD_POSTNAME),SavePostLog);
  1865.       break;
  1866.  
  1867.     default:
  1868.       return FALSE;
  1869.     }
  1870.       break;
  1871.  
  1872.     default:
  1873.       return FALSE;
  1874.       break;
  1875.     }
  1876.   return TRUE;
  1877. }
  1878.  
  1879. /*-- function WinVnMailDialog ---------------------------------------
  1880.  *
  1881.  *  Dialog function to query for mail destination, and manage list
  1882.  *  of mail addresses
  1883.  *  (JSC 2/1/94)
  1884.  */
  1885.  
  1886. BOOL FAR PASCAL 
  1887. WinVnMailDlg (hDlg, iMessage, wParam, lParam)
  1888.      HWND hDlg;
  1889.      unsigned iMessage;
  1890.      WPARAM wParam;
  1891.      LPARAM lParam;
  1892. {
  1893.   static HWND hMailList;       /* Handle to child list box window. */
  1894.   register int j; 
  1895.   int count, len, startLen, found;
  1896.   char *ptr;
  1897.   char mybuf[MAXDIALOGSTRING];
  1898.  
  1899.   switch (iMessage)
  1900.     {
  1901.     case WM_INITDIALOG:
  1902.       hMailList = GetDlgItem (hDlg, IDD_MAIL_LIST);
  1903.  
  1904.       SendMessage (hMailList, WM_SETREDRAW, FALSE, 0L);
  1905.       for (j = 0; j < (int)MailList->numLines; j++)
  1906.     SendMessage (hMailList, LB_ADDSTRING, 0, (LPARAM) ((LPSTR) TextBlockLine (MailList, j)));
  1907.  
  1908.       SendMessage (hMailList, WM_SETREDRAW, TRUE, 0L);
  1909.       EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  1910.       EnableWindow (GetDlgItem (hDlg, IDD_ADD), FALSE);
  1911.       return TRUE;
  1912.       break;
  1913.  
  1914.     case WM_COMMAND:
  1915.       switch (LOWORD(wParam))
  1916.       {
  1917.       case IDD_MAIL_LIST:
  1918.         switch (GET_WM_COMMAND_CMD(wParam,lParam))
  1919.         {
  1920.         case LBN_SELCHANGE:
  1921.            EnableWindow (GetDlgItem (hDlg, IDD_DELETE), TRUE);
  1922.            break;
  1923.  
  1924.         case LBN_DBLCLK:
  1925.         // a double click means they want to add a name to the to-line
  1926.         // only add it if it's not already on the to-line
  1927.  
  1928.         j = (int)SendMessage (hMailList, LB_GETCARETINDEX, 0, 0L);
  1929.         SendMessage (hMailList, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  1930.  
  1931.         GetDlgItemText (hDlg, IDD_MAIL_DEST, DialogString, MAXDIALOGSTRING-1);
  1932.         strcpy (str, DialogString);
  1933.     // test if name already on "To:" line
  1934.     // can't to a test with strstr() because mybuf may be a substring
  1935.     // of another address (i.e. 'jcoop' is a substr of 'jcooper@@apl.com')
  1936.         for (found = FALSE, ptr = str; *ptr; ptr += len + 1)
  1937.         {                                         
  1938.           // if there's only one token left, then len will = startLen, 
  1939.           // and we'll iterate once only
  1940.           startLen = strlen (ptr);
  1941.           if ((len = strcspn (ptr, " ,\n\t\r")) != startLen)
  1942.           { 
  1943.             ptr[len] = '\0';            // replace delim with NULL char
  1944.             while (strchr (" ,\n\t\r", ptr[len+1]))    // eat white space
  1945.               ptr[len++] = '\0';
  1946.           }
  1947.       if (!strcmp (ptr, mybuf))
  1948.           {
  1949.         found = TRUE;
  1950.         break;
  1951.       }
  1952.           if (len == startLen)        // last token, we're done
  1953.             break;
  1954.     }          
  1955.         if (!found)
  1956.     {
  1957.           if (strlen (mybuf) + strlen (DialogString) + 2 > MAXDIALOGSTRING-1)
  1958.       {
  1959.         MessageBox (hDlg, "Cannot add another address", "Address line is too long", MB_OK);                
  1960.             return FALSE;
  1961.           }
  1962.           if (DialogString[0])    // if this isn't the first one, prepend a comma
  1963.             strcat (DialogString, ", ");
  1964.           strcat (DialogString, mybuf);
  1965.           SetDlgItemText (hDlg, IDD_MAIL_DEST, DialogString);
  1966.         }
  1967.        }
  1968.     break;               
  1969.  
  1970.       case IDD_MAIL_DEST:
  1971.         GetDlgItemText (hDlg, IDD_MAIL_DEST, mybuf, MAXDIALOGSTRING-1);
  1972.         EnableWindow (GetDlgItem (hDlg, IDD_ADD), mybuf[0]);
  1973.         return FALSE;    /* let default handler act on these events */
  1974.         break;
  1975.  
  1976.       case IDD_ADD:
  1977.     // check addresses listed on to-line, add each one to list box 
  1978.     // (if not already in the list)
  1979.         GetDlgItemText (hDlg, IDD_MAIL_DEST, DialogString, MAXDIALOGSTRING-1);
  1980.         for (ptr = DialogString; *ptr; ptr += len + 1)
  1981.         {                                         
  1982.           // if there's only one token left, then len will = startLen, 
  1983.           // and we'll iterate once only
  1984.           startLen = strlen (ptr);
  1985.           if ((len = strcspn (ptr, " ,\n\t\r")) != startLen)
  1986.           { 
  1987.             ptr[len] = '\0';            // replace delim with NULL char
  1988.             while (strchr (" ,\n\t\r", ptr[len+1]))    // eat white space
  1989.               ptr[len++] = '\0';
  1990.           }
  1991.           if (*ptr != '\0')    // if not a blank
  1992.           {
  1993.             // check if it's already in the list
  1994.             count = (int)SendMessage (hMailList, LB_GETCOUNT, 0, 0L);
  1995.             for (j = 0; j < count; j++)
  1996.             {
  1997.               SendMessage (hMailList, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  1998.               if (!stricmp (ptr, mybuf))
  1999.                 break;
  2000.             }
  2001.             if (j == count)        // if not already in list, add it
  2002.               SendMessage (hMailList, LB_ADDSTRING, 0, (LPARAM) ((LPSTR) ptr));
  2003.           }          
  2004.           if (len == startLen)        // last token, we're done
  2005.             break;
  2006.         }          
  2007.        break;
  2008.             
  2009.       case IDD_DELETE:
  2010.     // remove all selected addresses from list box
  2011.         count = (int)SendMessage (hMailList, LB_GETCOUNT, 0, 0L);
  2012.         
  2013.     SendMessage (hMailList, WM_SETREDRAW, FALSE, 0L);
  2014.     
  2015.     // working backwards, delete selected items
  2016.         for (j = count-1; j >= 0; j--)
  2017.           if (SendMessage (hMailList, LB_GETSEL, j, 0L))
  2018.             SendMessage (hMailList, LB_DELETESTRING, j, 0L);
  2019.  
  2020.         SendMessage (hMailList, WM_SETREDRAW, TRUE, 0L);
  2021.         EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  2022.         break;
  2023.      
  2024.       case IDOK:
  2025.         GetDlgItemText (hDlg, IDD_MAIL_DEST, mybuf, MAXDIALOGSTRING-1);
  2026.     
  2027.     // make sure the address (if more than one) is comma separated
  2028.     DialogString[0]='\0';  
  2029.         for (ptr = mybuf; *ptr; ptr += len + 1)
  2030.         {                                         
  2031.           // if there's only one token left, then len will = startLen, 
  2032.           // and we'll iterate once only
  2033.           startLen = strlen (ptr);
  2034.           if ((len = strcspn (ptr, " ,\n\t\r")) != startLen)
  2035.           { 
  2036.             ptr[len] = '\0';            // replace delim with NULL char
  2037.             while (strchr (" ,\n\t\r", ptr[len+1]))    // eat white space
  2038.               ptr[len++] = '\0';
  2039.           }
  2040.       
  2041.       strcat (DialogString, ptr);
  2042.           
  2043.           if (len == startLen)        // last token, we're done
  2044.             break;
  2045.           else
  2046.             strcat (DialogString, ", ");
  2047.     }          
  2048.  
  2049.     // commit changes in listbox to internal MailList
  2050.     ResetTextBlock (MailList);
  2051.     count = (int)SendMessage (hMailList, LB_GETCOUNT, 0, 0L);
  2052.         for (j = 0; j < count; j++)
  2053.         {
  2054.       SendMessage (hMailList, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2055.       AddLineToTextBlock (MailList, mybuf);
  2056.     }
  2057.         
  2058.         EndDialog (hDlg, TRUE);
  2059.         break;
  2060.  
  2061.  
  2062.       case IDCANCEL:
  2063.         // changes to MailList are _not_ committed on Cancel
  2064.         EndDialog (hDlg, FALSE);
  2065.         break;
  2066.  
  2067.    default:
  2068.      return FALSE;
  2069.    }
  2070.       break;
  2071.  
  2072.     default:
  2073.       return FALSE;
  2074.       break;
  2075.     }
  2076.   return TRUE;
  2077. }
  2078.                                    
  2079.                                    
  2080. /*-- function WinVnSmartFilerDialog ---------------------------------------
  2081.  *
  2082.  *  Manages smart filer config
  2083.  *  (JSC 9/10/94)
  2084.  */
  2085.  
  2086. BOOL FAR PASCAL 
  2087. WinVnSmartFilerDlg (hDlg, iMessage, wParam, lParam)
  2088.      HWND hDlg;
  2089.      unsigned iMessage;
  2090.      WPARAM wParam;
  2091.      LPARAM lParam;
  2092. {
  2093.   static HWND hSourceList, hDosList;        /* extension mapping comboboxes */
  2094.   static HWND hDupeList, hShortenList;        /* options dropllists */
  2095.   static int MyEnableExtensionConversion;
  2096.   register int j; 
  2097.   int count, n, e;
  2098.   char mybuf[MAXDIALOGSTRING];
  2099.   BOOL ok;
  2100.  
  2101.   switch (iMessage)
  2102.     {
  2103.     case WM_INITDIALOG:
  2104.       hSourceList = GetDlgItem (hDlg, IDD_SOURCE_EXT_LIST);
  2105.       hDosList = GetDlgItem (hDlg, IDD_DOS_EXT_LIST);
  2106.       hDupeList = GetDlgItem (hDlg, IDD_AVOID_DUPES);
  2107.       hShortenList = GetDlgItem (hDlg, IDD_NAME_SHORTEN);
  2108.  
  2109.       SetDlgItemInt (hDlg, IDD_MAX_NAME_LEN, MaxFileNameLen, TRUE);
  2110.       SetDlgItemInt (hDlg, IDD_MAX_EXT_LEN, MaxFileExtLen, TRUE);
  2111.  
  2112.       CheckDlgButton (hDlg, IDD_ENABLE_CONVERSION, EnableExtensionConversion);
  2113.       EnableWindow (hSourceList, EnableExtensionConversion);
  2114.       EnableWindow (hDosList, EnableExtensionConversion);
  2115.       EnableWindow (GetDlgItem (hDlg, IDD_SOURCE_EXT), EnableExtensionConversion);
  2116.       EnableWindow (GetDlgItem (hDlg, IDD_DOS_EXT), EnableExtensionConversion);
  2117.  
  2118.       EnableWindow (GetDlgItem (hDlg, IDD_ADD), FALSE);
  2119.       EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  2120.       
  2121.       SendMessage (hSourceList, WM_SETREDRAW, FALSE, 0L);
  2122.       SendMessage (hDosList, WM_SETREDRAW, FALSE, 0L);
  2123.       SendMessage (hDupeList, WM_SETREDRAW, FALSE, 0L);
  2124.       SendMessage (hShortenList, WM_SETREDRAW, FALSE, 0L);
  2125.       for (j = 0; j < (int)ExtMapSourceList->numLines; j++)
  2126.       {
  2127.         SendMessage (hSourceList, LB_ADDSTRING, 0, (LPARAM)((LPCSTR)TextBlockLine (ExtMapSourceList, j)));
  2128.         SendMessage (hDosList, LB_ADDSTRING, 0, (LPARAM)((LPCSTR)TextBlockLine (ExtMapDosList, j)));
  2129.       }
  2130.       SendMessage (hDupeList, CB_INSERTSTRING, (WPARAM)DUPE_AVOID_NONE, (LPARAM)((LPCSTR)"Prompt for new file name"));
  2131.       SendMessage (hDupeList, CB_INSERTSTRING, (WPARAM)DUPE_AVOID_NUMBER_EXT, (LPARAM)((LPCSTR)"Replace extension with number"));
  2132.       SendMessage (hDupeList, CB_INSERTSTRING, (WPARAM)DUPE_AVOID_PREPEND_NUM, (LPARAM)((LPCSTR)"Preserve extension, prepend number to name"));
  2133.       SendMessage (hDupeList, CB_INSERTSTRING, (WPARAM)DUPE_AVOID_APPEND_NUM, (LPARAM)((LPCSTR)"Preserve extension, append number to name"));
  2134.  
  2135.       SendMessage (hShortenList, CB_INSERTSTRING, (WPARAM)SHORTEN_NONE, (LPARAM)((LPCSTR)"Prompt for new file name"));
  2136.       SendMessage (hShortenList, CB_INSERTSTRING, (WPARAM)SHORTEN_TRUNCATE, (LPARAM)((LPCSTR)"Truncate at max name length"));
  2137.       SendMessage (hShortenList, CB_INSERTSTRING, (WPARAM)SHORTEN_SKIP_VOWELS, (LPARAM)((LPCSTR)"Condense (skip vowels, punctuation)"));
  2138.  
  2139.       MyEnableExtensionConversion = EnableExtensionConversion;
  2140.  
  2141.       SendMessage(hDupeList, CB_SETCURSEL, (WPARAM)OnDupeName, 0L);
  2142.       SendMessage(hShortenList, CB_SETCURSEL, (WPARAM)OnNameTooLong, 0L);
  2143.       
  2144.       SendMessage (hSourceList, WM_SETREDRAW, TRUE, 0L);
  2145.       SendMessage (hDosList, WM_SETREDRAW, TRUE, 0L);
  2146.       SendMessage (hDupeList, WM_SETREDRAW, TRUE, 0L);
  2147.       SendMessage (hShortenList, WM_SETREDRAW, TRUE, 0L);
  2148.       
  2149.       return TRUE;
  2150.       break;
  2151.  
  2152.     case WM_VSCROLL:
  2153.       if ((HWND)lParam == hDosList)
  2154.           DebugBreak();
  2155.       return FALSE;
  2156.       break;      
  2157.                 
  2158.     case WM_COMMAND:
  2159.       switch (LOWORD(wParam))
  2160.       {
  2161.     case IDD_SOURCE_EXT_LIST:
  2162.         switch (GET_WM_COMMAND_CMD(wParam,lParam))
  2163.         {
  2164.         case LBN_SELCHANGE:
  2165.             j = (int)SendMessage (hSourceList, LB_GETCURSEL, 0, 0L);
  2166.             SendMessage (hDosList, LB_SETCURSEL, (WPARAM)j, 0L);
  2167.             EnableWindow (GetDlgItem (hDlg, IDD_DELETE), TRUE);
  2168.             return FALSE;    /* let the default handler do it */
  2169.             break;    
  2170.         }
  2171.         break;
  2172.        case IDD_DOS_EXT_LIST:
  2173.         switch (GET_WM_COMMAND_CMD(wParam,lParam))
  2174.         {
  2175.         case LBN_SELCHANGE:
  2176.             j = (int)SendMessage (hDosList, LB_GETCURSEL, 0, 0L);
  2177.             SendMessage (hSourceList, LB_SETCURSEL, (WPARAM)j, 0L);
  2178.             EnableWindow (GetDlgItem (hDlg, IDD_DELETE), TRUE);
  2179.             return FALSE;    /* let the default handler do it */
  2180.             break;    
  2181.         }
  2182.         break;
  2183.  
  2184.       case IDD_SOURCE_EXT:
  2185.       case IDD_DOS_EXT:
  2186.         GetDlgItemText (hDlg, IDD_SOURCE_EXT, mybuf, MAXDIALOGSTRING-1);
  2187.         GetDlgItemText (hDlg, IDD_DOS_EXT, str, MAXDIALOGSTRING-1);
  2188.         EnableWindow (GetDlgItem (hDlg, IDD_ADD), (str[0] && mybuf[0]));
  2189.         return FALSE;    /* let default handler act on these events */
  2190.         break;
  2191.           
  2192.       case IDD_ADD:
  2193.         GetDlgItemText (hDlg, IDD_SOURCE_EXT, DialogString, MAXDIALOGSTRING-1);
  2194.         GetDlgItemText (hDlg, IDD_DOS_EXT, str, MAXDIALOGSTRING-1);
  2195.  
  2196.         /* check if it's already in the list */
  2197.         count = (int)SendMessage (hSourceList, LB_GETCOUNT, 0, 0L);
  2198.         for (j = 0; j < count; j++)
  2199.         {
  2200.           SendMessage (hSourceList, LB_GETTEXT, (WPARAM)j, (LPARAM) ((LPSTR) mybuf));
  2201.           if (!stricmp (DialogString, mybuf))
  2202.             break;
  2203.         }
  2204.         if (j == count)    {    /* if not already in list, add it */
  2205.           SendMessage (hSourceList, LB_ADDSTRING, 0, (LPARAM) ((LPSTR) DialogString));
  2206.           SendMessage (hDosList, LB_ADDSTRING, 0, (LPARAM) ((LPSTR) str));
  2207.         } else {            /* if already in list, modify the dos ex */
  2208.           SendMessage (hDosList, LB_DELETESTRING, (WPARAM)j, 0L);
  2209.           SendMessage (hDosList, LB_INSERTSTRING, (WPARAM)j, (LPARAM) ((LPSTR) str));
  2210.         }  
  2211.         break;
  2212.             
  2213.       case IDD_DELETE:
  2214.         j = (int)SendMessage(hSourceList, LB_GETCURSEL, 0, 0L);
  2215.         SendMessage(hSourceList, LB_DELETESTRING, (WPARAM)j, 0L);
  2216.         SendMessage(hDosList, LB_DELETESTRING, (WPARAM)j, 0L);
  2217.         EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  2218.         break;
  2219.      
  2220.       case IDOK:
  2221.         n = GetDlgItemInt(hDlg, IDD_MAX_NAME_LEN, &ok, TRUE);
  2222.         e = GetDlgItemInt(hDlg, IDD_MAX_EXT_LEN, &ok, TRUE);
  2223. #ifdef WIN32
  2224.         if (n+e <= 0 || n+e > 255) {
  2225.              MessageBox (hDlg, "Names (name + extension) must be between 1 and 255 characters in length", "File Name Length Error", MB_OK);
  2226.              break;
  2227.         }
  2228.         if (e == 0 && MyEnableExtensionConversion) {
  2229.              if (MessageBox (hDlg, "With max extension length of 0, extension conversion must be disabled.  Continue?", "Warning", MB_YESNO) == IDNO)
  2230.                 break;                           
  2231.             else
  2232.                 MyEnableExtensionConversion = FALSE;
  2233.         }
  2234.         
  2235. #else
  2236.         if (n <=0 || n > 8) {
  2237.              MessageBox (hDlg, "DOS names must be between 0 and 8 characters in length", "File Name Length Error", MB_OK);
  2238.              break;
  2239.         }
  2240.         if (e <= 0 || e > 3) {
  2241.              MessageBox (hDlg, "DOS extensions must be between 0 and 3 characters in length", "File Extension Length Error", MB_OK);
  2242.              break;
  2243.         }
  2244. #endif /* WIN32 */
  2245.         MaxFileNameLen = n;
  2246.         MaxFileExtLen = e;
  2247.         OnDupeName = (int)SendMessage(hDupeList, CB_GETCURSEL, 0, 0L);
  2248.         OnNameTooLong = (int)SendMessage(hShortenList, CB_GETCURSEL, 0, 0L);
  2249.         EnableExtensionConversion = MyEnableExtensionConversion;
  2250.  
  2251.         /* commit changes in listbox to internal lists */
  2252.         ResetTextBlock (ExtMapSourceList);
  2253.         ResetTextBlock (ExtMapDosList);
  2254.         count = (int)SendMessage (hSourceList, LB_GETCOUNT, 0, 0L);
  2255.         for (j = 0; j < count; j++)
  2256.         {
  2257.             SendMessage (hSourceList, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2258.             AddLineToTextBlock (ExtMapSourceList, mybuf);
  2259.             SendMessage (hDosList, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2260.             AddLineToTextBlock (ExtMapDosList, mybuf);
  2261.         }
  2262.             
  2263.         EndDialog (hDlg, TRUE);
  2264.         break;
  2265.  
  2266.  
  2267.       case IDCANCEL:
  2268.         /* changes to lists are _not_ committed on Cancel */
  2269.         EndDialog (hDlg, FALSE);
  2270.         break;
  2271.  
  2272.       case IDD_ENABLE_CONVERSION:
  2273.         MyEnableExtensionConversion = !MyEnableExtensionConversion;
  2274.         CheckDlgButton (hDlg, IDD_ENABLE_CONVERSION, MyEnableExtensionConversion);
  2275.         SendMessage (hSourceList, LB_SETCURSEL, (WPARAM)-1, 0L);    /* deselect */
  2276.         SendMessage (hDosList, LB_SETCURSEL, (WPARAM)-1, 0L);
  2277.         EnableWindow (hSourceList, MyEnableExtensionConversion);
  2278.         EnableWindow (hDosList, MyEnableExtensionConversion);
  2279.         EnableWindow (GetDlgItem (hDlg, IDD_SOURCE_EXT), MyEnableExtensionConversion);
  2280.         EnableWindow (GetDlgItem (hDlg, IDD_DOS_EXT), MyEnableExtensionConversion);
  2281.         if (!MyEnableExtensionConversion) {
  2282.            EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  2283.            EnableWindow (GetDlgItem (hDlg, IDD_DELETE), FALSE);
  2284.         }
  2285.         break;
  2286.  
  2287.    default:
  2288.      return FALSE;
  2289.    }
  2290.       break;
  2291.  
  2292.     default:
  2293.       return FALSE;
  2294.       break;
  2295.     }
  2296.   return TRUE;
  2297. }
  2298.                                    
  2299. @
  2300.  
  2301.  
  2302. 1.31
  2303. log
  2304. @New SmartFiler, Cc-by-mail dialogs.  massive cleanup for 92.6
  2305. @
  2306. text
  2307. @d3 1
  2308. a3 1
  2309.  * $Id: wvcncm.c 1.29 1994/08/24 18:00:29 jcooper Exp $
  2310. d5 3
  2311. d172 4
  2312. a175 1
  2313.  
  2314. a198 1
  2315.      GetDlgItemText(hDlg, IDD_SPEED, pszCommSpeed, MAXCOMMSPEEDCHARS - 1);
  2316. d201 1
  2317. d527 6
  2318. d1368 1
  2319. d1378 1
  2320. a1378 1
  2321.       CheckDlgButton (hDlg, ID_CONFIG_ARTICLE_FIXED_FONT, ArticleFixedFont);
  2322. d1390 2
  2323. a1391 1
  2324.  
  2325. a1406 1
  2326.      ArticleFixedFont = (IsDlgButtonChecked (hDlg, ID_CONFIG_ARTICLE_FIXED_FONT) != 0);
  2327. d1416 2
  2328. d1419 6
  2329. a1424 1
  2330.      
  2331. @
  2332.  
  2333.  
  2334. 1.30
  2335. log
  2336. @fix maildlg for win32
  2337. @
  2338. text
  2339. @a104 2
  2340. #include <stdlib.h>
  2341. #include <limits.h>
  2342. d109 4
  2343. d251 1
  2344. d375 1
  2345. d403 3
  2346. a405 2
  2347.      if (AskForNewFileName (hDlg, SaveArtFileName, "") == SUCCESS)
  2348.        SetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName);
  2349. d445 1
  2350. d454 1
  2351. d464 1
  2352. a464 1
  2353.  
  2354. d470 3
  2355. a472 2
  2356.      if (AskForNewFileName (hDlg, SaveArtFileName, "") == SUCCESS)
  2357.        SetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName);
  2358. d519 2
  2359. d533 1
  2360. a533 1
  2361.          MessageBox (hDlg, "Please enter a path name before continuing", "Decode Path", ID_OK);
  2362. d537 9
  2363. a545 2
  2364.       if (str[len-1] == '\\')
  2365.          str[len-1] = '\0';
  2366. d547 4
  2367. a550 3
  2368.             DumbDecode = IsDlgButtonChecked (hDlg, IDD_DUMB_DECODE);
  2369.             CodingStatusVerbose = IsDlgButtonChecked (hDlg, IDD_VERBOSE_STATUS);
  2370.       ExecuteDecodedFiles = IsDlgButtonChecked (hDlg, IDD_EXECUTE_DECODED);
  2371. d563 4
  2372. d682 14
  2373. a695 3
  2374.       if (!getWndEdit(WndMails, GetWindow (hDlg, GW_OWNER), MAXMAILWNDS))
  2375.           ReviewAttach = IsDlgButtonChecked (hDlg, IDD_REVIEW); // posting
  2376.         
  2377. d709 1
  2378. a709 1
  2379.                   MessageBox (hDlg, temp, "Article Split Length Error", ID_OK);
  2380. d716 1
  2381. a716 1
  2382.               MessageBox (hDlg, "The article split length must be a NUMBER of bytes", "Article Split Length Error", ID_OK);
  2383. d812 1
  2384. a812 1
  2385.           MessageBox (hDlg, "Please enter a filename to encode", "Filename error", ID_OK);
  2386. d816 7
  2387. d893 1
  2388. a893 1
  2389.                   MessageBox (hDlg, "Invalid encoding table.  The table must contain 64 characters.", "Custom Encoding Error", ID_OK);
  2390. d903 1
  2391. a903 1
  2392.               MessageBox (hDlg, "To use a custom encoding, you must enter an encoding table", "Custom Encoding Error", ID_OK);
  2393. d997 1
  2394. a1007 2
  2395.   static int SaveNewsrc, SaveConfig;
  2396.  
  2397. a1010 1
  2398.       SaveNewsrc = SaveConfig = 1;
  2399. d1020 2
  2400. a1021 6
  2401.       if (SaveNewsrc && !Initializing)
  2402.         WriteNewsrc ();
  2403.       
  2404.       if (SaveConfig)
  2405.           WriteWinvnProfile();
  2406.         
  2407. a1024 10
  2408.     case IDD_SAVE_NEWSRC:
  2409.       SaveNewsrc = !SaveNewsrc;
  2410.       CheckDlgButton (hDlg, IDD_SAVE_NEWSRC, SaveNewsrc);
  2411.       break;
  2412.  
  2413.     case IDD_SAVE_CONFIG:
  2414.       SaveConfig = !SaveConfig;
  2415.       CheckDlgButton (hDlg, IDD_SAVE_CONFIG, SaveConfig);
  2416.       break;
  2417.  
  2418. d1148 2
  2419. d1152 14
  2420. a1166 1
  2421.     case WM_INITDIALOG:
  2422. d1172 2
  2423. d1180 14
  2424. d1203 4
  2425. d1586 1
  2426. d1644 12
  2427. a1678 1
  2428.  
  2429. d1693 1
  2430. a1693 1
  2431.   HWND hDlgList;       /* Handle to child list box window. */
  2432. d1702 1
  2433. a1702 1
  2434.       hDlgList = GetDlgItem (hDlg, IDD_MAIL_LIST);
  2435. d1704 1
  2436. a1704 1
  2437.       SendMessage (hDlgList, WM_SETREDRAW, FALSE, 0L);
  2438. d1706 1
  2439. a1706 1
  2440.     SendMessage (hDlgList, LB_ADDSTRING, 0, (LONG) TextBlockLine (MailList, j));
  2441. d1708 3
  2442. a1710 1
  2443.       SendMessage (hDlgList, WM_SETREDRAW, TRUE, 0L);
  2444. d1718 7
  2445. a1724 6
  2446. #ifdef WIN32
  2447.     if (GET_WM_COMMAND_CMD(wParam,lParam) != LBN_DBLCLK)
  2448. #else
  2449.     if (HIWORD(lParam) != LBN_DBLCLK)
  2450. #endif /* WIN32 */
  2451.           break;
  2452. d1728 2
  2453. a1729 2
  2454.         j = (int)SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETCARETINDEX, 0, 0L);
  2455.         SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2456. d1759 1
  2457. a1759 1
  2458.         MessageBox (hDlg, "Cannot add another address", "Address line is too long", ID_OK);                
  2459. d1767 1
  2460. d1770 6
  2461. a1779 1
  2462.         hDlgList = GetDlgItem (hDlg, IDD_MAIL_LIST);
  2463. d1794 1
  2464. a1794 1
  2465.             count = (int)SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETCOUNT, 0, 0L);
  2466. d1797 1
  2467. a1797 1
  2468.               SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2469. d1802 1
  2470. a1802 1
  2471.               SendMessage (hDlgList, LB_ADDSTRING, 0, (LONG) ptr);
  2472. d1806 2
  2473. a1807 2
  2474.     }          
  2475.         break;
  2476. d1811 1
  2477. a1811 1
  2478.         count = (int)SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETCOUNT, 0, 0L);
  2479. d1813 1
  2480. a1813 2
  2481.         hDlgList = GetDlgItem (hDlg, IDD_MAIL_LIST);
  2482.     SendMessage (hDlgList, WM_SETREDRAW, FALSE, 0L);
  2483. d1817 2
  2484. a1818 2
  2485.           if (SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETSEL, j, 0L))
  2486.             SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_DELETESTRING, j, 0L);
  2487. d1820 2
  2488. a1821 1
  2489.         SendMessage (hDlgList, WM_SETREDRAW, TRUE, 0L);
  2490. d1851 1
  2491. a1851 1
  2492.     count = (int)SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETCOUNT, 0, 0L);
  2493. d1854 1
  2494. a1854 1
  2495.       SendDlgItemMessage (hDlg, IDD_MAIL_LIST, LB_GETTEXT, j, (LPARAM) ((LPSTR) mybuf));
  2496. d1879 219
  2497. @
  2498.  
  2499.  
  2500.  
  2501. 1.29
  2502. log
  2503. @misc encoding/decoding changes
  2504. @
  2505. text
  2506. @d3 1
  2507. a3 1
  2508.  * $Id: wvcncm.c 1.28 1994/08/11 00:09:17 jcooper Exp $
  2509. d5 3
  2510. d107 2
  2511. a108 1
  2512. #include "windows.h"
  2513. d1619 2
  2514. a1620 2
  2515.      WORD wParam;
  2516.      LONG lParam;
  2517. d1642 1
  2518. a1642 1
  2519.       switch (wParam)
  2520. d1645 6
  2521. a1650 2
  2522.         if (HIWORD(lParam) != LBN_DBLCLK)
  2523.           break;
  2524. d1653 1
  2525. a1653 1
  2526.           
  2527. @
  2528.  
  2529.  
  2530.  
  2531. 1.28
  2532. log
  2533. @Enhancements to Mime and article encoding/encoding
  2534. @
  2535. text
  2536. @d3 1
  2537. a3 1
  2538.  * $Id: wvcncm.c 1.27 1994/07/25 22:41:22 pearse_w_r Exp $
  2539. d5 3
  2540. d395 1
  2541. a395 1
  2542.      if (AskForExistingFileName (hDlg, SaveArtFileName, "Select Save File") == SUCCESS)
  2543. d459 1
  2544. a459 1
  2545.      if (AskForExistingFileName (hDlg, SaveArtFileName, "Select Save File") == SUCCESS)
  2546. d571 1
  2547. a571 1
  2548.   int genMIME;
  2549. d614 1
  2550. d692 3
  2551. a694 2
  2552.             
  2553.           if (GenerateMIME && EncodingTypeNum != CODE_BASE64)
  2554. d696 2
  2555. d699 2
  2556. a700 1
  2557.               if (MessageBox (hDlg, str, "MIME Usage Suggestion", MB_YESNO|MB_ICONINFORMATION) == IDYES)
  2558. d702 2
  2559. d705 6
  2560. a710 5
  2561.           } 
  2562.           if (!GenerateMIME && EncodingTypeNum == CODE_BASE64)
  2563.           {
  2564.               if (MessageBox (hDlg, "When using Base-64 encoding, MIME header generation is recommended.\nWould you like to activate MIME header generation?", 
  2565.                   "MIME Usage Suggestion", MB_YESNO|MB_ICONINFORMATION) == IDYES)
  2566. d712 3
  2567. a715 1
  2568.  
  2569. @
  2570.  
  2571.  
  2572.  
  2573. 1.27
  2574. log
  2575. @ShowUnreadOnly option
  2576. @
  2577. text
  2578. @d3 1
  2579. a3 1
  2580.  * $Id: wvcncm.c 1.26 1994/07/25 18:51:48 jcooper Exp pearse_w_r $
  2581. d5 3
  2582. d568 1
  2583. d577 35
  2584. d620 2
  2585. a639 9
  2586.     SendDlgItemMessage(hDlg, IDD_ARTICLE_SPLIT_LENGTH,
  2587.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "32000"));
  2588.     SendDlgItemMessage(hDlg, IDD_ARTICLE_SPLIT_LENGTH,
  2589.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) uitoa(MAXPOSTLENGTH, str, 10)));
  2590.  
  2591.     SetDlgItemText (hDlg, IDD_ARTICLE_SPLIT_LENGTH, uitoa (ArticleSplitLength, str, 10));
  2592.         
  2593.     SetupEncodingOptions (hDlg);
  2594.  
  2595. a640 2
  2596.     
  2597.     SetDlgItemText (hDlg, IDD_SUBJECT_TEMPLATE, SubjectTemplate);
  2598. a641 17
  2599.     CheckRadioButton (hDlg,IDD_ATTACH_NOW, IDD_ATTACH_NEXT, AttachInNewArt?IDD_ATTACH_NEXT:IDD_ATTACH_NOW);
  2600.  
  2601.     // this feature is only available when posting (not when mailing)
  2602.     if (!getWndEdit(WndMails, GetWindow (hDlg, GW_OWNER), MAXMAILWNDS))
  2603.     {
  2604.         EnableWindow (GetDlgItem (hDlg, IDD_REVIEW), TRUE);        // posting
  2605.         EnableWindow (GetDlgItem (hDlg, IDD_NO_REVIEW), TRUE);
  2606.     }
  2607.     else
  2608.     {
  2609.         EnableWindow (GetDlgItem (hDlg, IDD_REVIEW), FALSE);    // mailing
  2610.         EnableWindow (GetDlgItem (hDlg, IDD_NO_REVIEW), FALSE);
  2611.     }
  2612.             
  2613.     CheckRadioButton (hDlg,IDD_REVIEW, IDD_NO_REVIEW, ReviewAttach?IDD_REVIEW:IDD_NO_REVIEW);
  2614.  
  2615.        CheckDlgButton (hDlg, IDD_MAKE_DEFAULT, 0);
  2616. d650 5
  2617. a654 4
  2618.       GetDlgItemText (hDlg, IDD_CONTENT_TYPE, (LPSTR) ContentType, MAXINTERNALLINE);
  2619.       if (IsDlgButtonChecked (hDlg, IDD_MAKE_DEFAULT))
  2620.          strcpy (DefaultContentType, ContentType);
  2621.  
  2622. a678 2
  2623.       GetDlgItemText (hDlg, IDD_MIME_BOUNDARY, MIMEBoundary, MAXBOUNDARYLEN);
  2624.       // *** should check here that characters in boundary are all valid
  2625. d682 20
  2626. a701 1
  2627.         AttachInNewArt = IsDlgButtonChecked (hDlg, IDD_ATTACH_NEXT);
  2628. a702 4
  2629.       // this feature is only available when posting (not when mailing)
  2630.       if (!getWndEdit(WndMails, GetWindow (hDlg, GW_OWNER), MAXMAILWNDS))
  2631.           ReviewAttach = IsDlgButtonChecked (hDlg, IDD_REVIEW); // posting
  2632.         
  2633. d706 7
  2634. d760 6
  2635. a765 1
  2636.  
  2637. d1126 1
  2638. a1126 1
  2639.      if (!str[0] || !strcmp (str, MailAddress))
  2640. @
  2641.  
  2642.  
  2643.  
  2644. 1.26
  2645. log
  2646. @execution of decoded files
  2647. @
  2648. text
  2649. @d3 1
  2650. a3 1
  2651.  * $Id: wvcncm.c 1.25 1994/06/08 21:01:45 gardnerd Exp $
  2652. d5 3
  2653. d1261 1
  2654. d1287 2
  2655. @
  2656.  
  2657.  
  2658.  
  2659. 1.25
  2660. log
  2661. @more scrolling changes...
  2662. @
  2663. text
  2664. @d3 1
  2665. a3 1
  2666.  * $Id: wvcncm.c 1.24 1994/05/26 22:11:04 jglasser Exp $
  2667. d5 3
  2668. d385 5
  2669. d449 5
  2670. d495 3
  2671. a497 2
  2672.       SendDlgItemMessage(hDlg, IDD_DUMB_DECODE, BM_SETCHECK, (WPARAM) DumbDecode, 0);
  2673.       SendDlgItemMessage(hDlg, IDD_VERBOSE_STATUS, BM_SETCHECK, (WPARAM) CodingStatusVerbose, 0);
  2674. d517 3
  2675. a519 3
  2676.             DumbDecode = (BOOL)SendDlgItemMessage(hDlg, IDD_DUMB_DECODE, BM_GETCHECK, 0, 0);
  2677.             CodingStatusVerbose = (BOOL)SendDlgItemMessage(hDlg, IDD_VERBOSE_STATUS, BM_GETCHECK, 0, 0);
  2678.             
  2679. d523 6
  2680. d625 1
  2681. a625 1
  2682.        SendDlgItemMessage(hDlg, IDD_MAKE_DEFAULT, BM_SETCHECK, 0 , 0);
  2683. d635 1
  2684. a635 1
  2685.       if (SendDlgItemMessage(hDlg, IDD_MAKE_DEFAULT, BM_GETCHECK, 0, 0))
  2686. d667 1
  2687. a667 1
  2688.         AttachInNewArt = (BOOL)SendDlgItemMessage(hDlg, IDD_ATTACH_NEXT, BM_GETCHECK, 0, 0);
  2689. d671 1
  2690. a671 1
  2691.           ReviewAttach = (BOOL)SendDlgItemMessage(hDlg, IDD_REVIEW, BM_GETCHECK, 0, 0);    // posting
  2692. d713 1
  2693. d722 2
  2694. d734 5
  2695. d1257 1
  2696. d1282 1
  2697. d1317 1
  2698. a1317 1
  2699. /*  if (write_ini)         (JSC - Now close on exit of app)
  2700. d1380 4
  2701. d1389 1
  2702. a1389 1
  2703.      arts_to_retrieve = atoi (manual);
  2704. d1394 4
  2705. @
  2706.  
  2707.  
  2708.  
  2709. 1.24
  2710. log
  2711. @warnings
  2712. @
  2713. text
  2714. @d3 1
  2715. a3 1
  2716.  * $Id: wvcncm.c 1.23 1994/05/23 19:51:51 rushing Exp jglasser $
  2717. d5 3
  2718. d1265 1
  2719. @
  2720.  
  2721.  
  2722.  
  2723. 1.23
  2724. log
  2725. @NNTPPort becomes NNTPService, and it's a string.
  2726. @
  2727. text
  2728. @d3 1
  2729. a3 1
  2730.  * $Id: wvcncm.c 1.22 1994/05/23 18:37:00 jcooper Exp rushing $
  2731. d5 3
  2732. d539 1
  2733. a539 1
  2734.   extern char *ContentTypes[];
  2735. d729 1
  2736. a729 1
  2737.   extern char *EncodingTypes[];
  2738. @
  2739.  
  2740.  
  2741.  
  2742. 1.22
  2743. log
  2744. @new attach code, session [dis]connect
  2745. @
  2746. text
  2747. @d3 1
  2748. a3 1
  2749.  * $Id: wvcncm.c 1.21 1994/05/02 19:49:56 rushing Exp $
  2750. d5 3
  2751. d115 1
  2752. a115 1
  2753.   static char pszMyNNTPPort[MAXSTR];
  2754. d141 1
  2755. a141 2
  2756.       sprintf (pszMyNNTPPort, "%d", NNTPPort);
  2757.       SetDlgItemText (hDlg, ID_CONFIG_NNTP_PORT, pszMyNNTPPort);
  2758. d183 1
  2759. a183 1
  2760.      GetDlgItemText (hDlg, ID_CONFIG_NNTP_PORT, pszMyNNTPPort, MAXSTR);
  2761. a187 1
  2762.      NNTPPort = atoi (pszMyNNTPPort);
  2763. d201 1
  2764. a201 1
  2765.         (szAppName, "NNTPPort", pszMyNNTPPort, szAppProFile);
  2766. @
  2767.  
  2768.  
  2769.  
  2770. 1.21
  2771. log
  2772. @changes from jody glasser
  2773. @
  2774. text
  2775. @d3 1
  2776. a3 1
  2777.  * $Id: wvcncm.c 1.20 1994/03/01 19:10:19 rushing Exp rushing $
  2778. d5 3
  2779. d534 3
  2780. a536 1
  2781.   
  2782. d543 8
  2783. a550 21
  2784.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2785.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Text/Plain"));
  2786.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2787.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Text/Richtext"));
  2788.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2789.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Video/MPEG"));
  2790.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2791.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Video/AVI"));
  2792.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2793.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Image/JPEG"));
  2794.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2795.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Image/GIF"));
  2796.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2797.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Audio/Basic"));
  2798.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2799.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Application/Zip"));
  2800.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2801.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Application/PostScript"));
  2802.     SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE,
  2803.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Other"));
  2804.  
  2805. d560 1
  2806. a560 1
  2807.     else if (!_stricmp (temp, "avi"))
  2808. d564 1
  2809. a564 1
  2810.     else if (!_stricmp (temp, "txt") || !_strnicmp (temp, "bat", 3) || !_strnicmp (temp,"c",1))
  2811. d567 1
  2812. a567 1
  2813.         SendDlgItemMessage(hDlg, IDD_CONTENT_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "Other"));
  2814. d582 17
  2815. a598 5
  2816.     if (WhenToAttach != IDD_ATTACH_NOW && WhenToAttach != IDD_ATTACH_NEXT)
  2817.         WhenToAttach = IDD_ATTACH_NOW;
  2818.         
  2819.     CheckRadioButton (hDlg,IDD_ATTACH_NOW, IDD_ATTACH_NEXT, WhenToAttach);
  2820.           SendDlgItemMessage(hDlg, IDD_REVIEW_ATTACH, BM_SETCHECK, (WPARAM) ReviewAttach, 0);
  2821. d608 2
  2822. d640 1
  2823. a640 4
  2824.             if (SendDlgItemMessage(hDlg, IDD_ATTACH_NOW, BM_GETCHECK, 0, 0))
  2825.                 WhenToAttach = IDD_ATTACH_NOW;
  2826.             else
  2827.                 WhenToAttach = IDD_ATTACH_NEXT;
  2828. d642 4
  2829. a645 2
  2830. //        ReviewAttach = (BOOL)SendDlgItemMessage(hDlg, IDD_REVIEW_ATTACH, BM_GETCHECK, 0, 0);
  2831.  
  2832. d724 3
  2833. d729 3
  2834. a731 10
  2835.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE,    
  2836.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Base-64"));
  2837.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE,
  2838.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "UU"));
  2839.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE,
  2840.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "XX"));
  2841.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE,
  2842.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "Custom"));
  2843.     SendDlgItemMessage(hDlg, IDD_CODING_TYPE,
  2844.         CB_ADDSTRING, 0, (LPARAM) ((LPSTR) "None"));
  2845. d733 4
  2846. a736 4
  2847.     if (EncodingType == 0)
  2848.         SendDlgItemMessage(hDlg, IDD_CODING_TYPE, CB_SELECTSTRING, (WPARAM)-1, (LPARAM) ((LPSTR) "None"));
  2849.     else
  2850.         SendDlgItemMessage(hDlg, IDD_CODING_TYPE, CB_SETCURSEL, EncodingType - 1, 0);
  2851. d772 5
  2852. a776 7
  2853.           
  2854.     if (!_stricmp (temp, "None"))
  2855.                  EncodingType = 0;
  2856.            else
  2857.                  EncodingType = select + 1;
  2858.  
  2859.            return (OK);
  2860. d1221 1
  2861. d1245 1
  2862. @
  2863.  
  2864.  
  2865.  
  2866. 1.20
  2867. log
  2868. @ThreadFullSubject option added
  2869. @
  2870. text
  2871. @d3 1
  2872. a3 1
  2873.  * $Id: wvcncm.c 1.19 1994/02/24 21:27:28 jcoop Exp rushing $
  2874. d5 3
  2875. d1221 1
  2876. d1244 1
  2877. d1374 5
  2878. @
  2879.  
  2880.  
  2881.  
  2882. 1.19
  2883. log
  2884. @jcoop changes
  2885. @
  2886. text
  2887. @d3 1
  2888. a3 1
  2889.  * $Id: wvcncm.c 1.18 1994/01/24 17:39:47 jcoop Exp $
  2890. d5 3
  2891. d1213 1
  2892. d1239 1
  2893. d1676 1
  2894. a1676 1
  2895.                                    @
  2896.  
  2897.  
  2898.  
  2899. 1.18
  2900. log
  2901. @90.2 changes
  2902. @
  2903. text
  2904. @d3 1
  2905. a3 1
  2906.  * $Id: wvcncm.c 1.17 1994/01/16 12:02:59 jcoop Exp $
  2907. d5 3
  2908. d176 1
  2909. a176 1
  2910.       NNTPPasswordEncrypted);
  2911. d179 1
  2912. a179 1
  2913.           MailDemandLogon = SaveDemand ;
  2914. d888 2
  2915. a889 2
  2916.           
  2917.         EndDialog (hDlg, TRUE);
  2918. d965 1
  2919. a965 1
  2920. /*-- function WinVnSubjectDlg ---------------------------------------
  2921. d991 2
  2922. a992 2
  2923.      GetDlgItemText (hDlg, IDD_SUBJECT_STRING,
  2924.            DialogString, MAXDIALOGSTRING - 1);
  2925. d1013 54
  2926. d1212 3
  2927. d1233 2
  2928. d1483 189
  2929. @
  2930.  
  2931.  
  2932.  
  2933. 1.17
  2934. log
  2935. @INI stuff now all written in winvn.c.  New dialogs for en/decoding
  2936. @
  2937. text
  2938. @d3 1
  2939. a3 1
  2940.  * $Id: wvcncm.c 1.17 1994/01/16 00:45:52 jcoop Exp $
  2941. d5 3
  2942. d1154 1
  2943. d1172 1
  2944. @
  2945.  
  2946.  
  2947.  
  2948. 1.16
  2949. log
  2950. @mrr mods 4
  2951. @
  2952. text
  2953. @a0 1
  2954.  
  2955. d3 1
  2956. a3 1
  2957.  * $Id: wvcncm.c 1.15 1993/12/08 01:27:21 rushing Exp $
  2958. d5 3
  2959. d75 2
  2960. a174 15
  2961.      if (write_ini)
  2962.        {
  2963. /*       WritePrivateProfileString
  2964.       (szAppName, "CommString", szCommString, szAppProFile);
  2965. */
  2966.          WritePrivateProfileString
  2967.       (szAppName, "NNTPHost", NNTPHost, szAppProFile);
  2968.          WritePrivateProfileString
  2969.       (szAppName, "SMTPHost", SMTPHost, szAppProFile);
  2970.          WritePrivateProfileString
  2971.       (szAppName, "NNTPPort", pszMyNNTPPort, szAppProFile);
  2972.          WritePrivateProfileString
  2973.       (szAppName, "NNTPUserName", NNTPUserName, szAppProFile);
  2974.          WritePrivateProfileString
  2975.       (szAppName, "NNTPPassword", NNTPPasswordEncrypted, szAppProFile);
  2976. d176 18
  2977. a193 4
  2978.          WritePrivateProfileInt (szAppName, "MailForceType",
  2979.                   saveMailForceType, szAppProFile);
  2980.          WritePrivateProfileInt (szAppName, "MailDemandLogon",
  2981.                   MailDemandLogon, szAppProFile);
  2982. d195 6
  2983. a200 4
  2984. /*
  2985.          cptr = MyCommModeID == ID_COMMTCP ? "1" : "0";
  2986.          WritePrivateProfileString (szAppName, "UseSocket", cptr, szAppProFile);
  2987.          WritePrivateProfileInt (szAppName, "AskComm", AskComm, szAppProFile);
  2988. a201 1
  2989.        }
  2990. d211 1
  2991. a211 1
  2992.           }
  2993. d259 6
  2994. a264 6
  2995.       break;
  2996.  
  2997.     default:
  2998.       return FALSE;
  2999.       break;
  3000.     }
  3001. d386 1
  3002. d440 472
  3003. d1089 1
  3004. a1089 1
  3005.      if (write_ini)
  3006. d1095 1
  3007. a1095 1
  3008.      dialog_val = TRUE;
  3009. d1196 3
  3010. a1198 3
  3011.       {
  3012.         DoList = item - ID_DOLIST_BASE;
  3013.       }
  3014. d1201 24
  3015. a1224 16
  3016.      if (write_ini)
  3017.        {
  3018.          WritePrivateProfileInt
  3019.       (szAppName, "SaveArtAppend", SaveArtAppend, szAppProFile);
  3020.          WritePrivateProfileInt
  3021.       (szAppName, "NewWndGroup", ViewNew, szAppProFile);
  3022.          WritePrivateProfileInt
  3023.       (szAppName, "NewWndArticle", NewArticleWindow, szAppProFile);
  3024.          WritePrivateProfileInt
  3025.       (szAppName, "DoList", DoList, szAppProFile);
  3026.          WritePrivateProfileInt
  3027.       (szAppName, "ArticleFixedFont", ArticleFixedFont, szAppProFile);
  3028.          WritePrivateProfileInt
  3029.       (szAppName, "ArticleThreshold", article_threshold, szAppProFile);
  3030.          WritePrivateProfileInt
  3031.       (szAppName, "FullNameFrom", FullNameFrom, szAppProFile);
  3032. a1225 10
  3033.          WritePrivateProfileInt
  3034.       (szAppName, "EnableThreading", threadp, szAppProFile);
  3035.          WritePrivateProfileInt
  3036.       (szAppName, "ShowUnsubscribed", ShowUnsubscribed, szAppProFile);
  3037.  
  3038.        }
  3039.      dialog_val = TRUE;
  3040.      goto endit;
  3041.      break;
  3042.  
  3043. a1326 13
  3044. BOOL
  3045. WritePrivateProfileInt (lpAppName, lpKeyName, intval,lpProFile)
  3046.      char far *lpAppName;
  3047.      char far *lpKeyName;
  3048.      char far *lpProFile;
  3049.      int intval;
  3050. {
  3051.   char msg[20];
  3052.  
  3053.   itoa (intval, msg, 10);
  3054.   return (WritePrivateProfileString (lpAppName, lpKeyName, msg, lpProFile));
  3055. }
  3056.  
  3057. d1374 10
  3058. a1383 12
  3059.      if (write_ini)
  3060.        {
  3061.          WritePrivateProfileString
  3062.       (szAppName, "MailLogFile", MailLogFile, szAppProFile);
  3063.          WritePrivateProfileString
  3064.       (szAppName, "PostLogFile", PostLogFile, szAppProFile);
  3065.  
  3066.          WritePrivateProfileInt (szAppName, "MailLog",
  3067.                   MailLog, szAppProFile);
  3068.          WritePrivateProfileInt (szAppName, "PostLog",
  3069.                   PostLog, szAppProFile);
  3070.  
  3071. d1385 3
  3072. d1389 3
  3073. d1393 10
  3074. a1402 2
  3075.      EndDialog (hDlg, TRUE);
  3076.      break;
  3077. d1404 3
  3078. a1406 19
  3079.    case IDCANCEL:
  3080.      EndDialog (hDlg, FALSE);
  3081.      break;
  3082.  
  3083.    case IDD_MAILLOG:
  3084.      SaveMailLog = !SaveMailLog;
  3085.      CheckDlgButton (hDlg, IDD_MAILLOG, SaveMailLog);
  3086.      EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  3087.      break;
  3088.  
  3089.    case IDD_POSTLOG:
  3090.      SavePostLog = !SavePostLog;
  3091.      CheckDlgButton (hDlg, IDD_POSTLOG, SavePostLog);
  3092.      EnableWindow(GetDlgItem(hDlg,IDD_POSTNAME),SavePostLog);
  3093.      break;
  3094.  
  3095.    default:
  3096.      return FALSE;
  3097.    }
  3098. @
  3099.  
  3100.  
  3101.  
  3102. 1.15
  3103. log
  3104. @new version box and cr lf consistency
  3105. @
  3106. text
  3107. @d4 1
  3108. a4 1
  3109.  * $Id: wvcncm.c 1.14 1993/08/25 18:53:17 mbretherton Exp rushing $
  3110. d6 3
  3111. d105 1
  3112. a105 1
  3113.     AskComm = ASK_COMM_NEVER;
  3114. d121 3
  3115. a123 3
  3116.         SetDlgItemText (hDlg, ID_CONFIG_AUTH_USERNAME, NNTPUserName);
  3117.         MRRDecrypt(NNTPPasswordEncrypted,(unsigned char *)NNTPPassword, MAXNNTPSIZE);
  3118.         SetDlgItemText (hDlg, ID_CONFIG_AUTH_PASSWORD, NNTPPassword);
  3119. d127 1
  3120. a127 1
  3121.     mail_force_radio = IDD_MAIL_SELECT_AUTO;
  3122. d129 1
  3123. a129 1
  3124.     mail_force_radio = MailForceType + IDD_MAIL_SELECT_NONE;
  3125. d132 1
  3126. a132 1
  3127.             IDD_MAIL_SELECT_AUTO, mail_force_radio);
  3128. d144 5
  3129. a148 5
  3130.     {
  3131.     case ID_OK_SAVE:
  3132.       write_ini = TRUE;
  3133.     case IDOK:
  3134.       GetDlgItemText(hDlg, IDD_SPEED, pszCommSpeed, MAXCOMMSPEEDCHARS - 1);
  3135. d151 4
  3136. a154 4
  3137.       CommPortID = MyCommPortID;
  3138.       CommParityID = MyCommParityID;
  3139.       CommIDtoStr (CommPortID, CommParityID, pszCommSpeed, szCommString);
  3140.       WinVnDoComm (szCommString);
  3141. d156 2
  3142. a157 2
  3143.       if (Initializing)
  3144.         UsingSocket = (MyCommModeID == ID_COMMTCP);
  3145. d159 10
  3146. a168 10
  3147.       UsingSocket = 1;
  3148.       GetDlgItemText (hDlg, ID_CONFIG_NNTP_SERVER, NNTPHost, MAXNNTPSIZE);
  3149.       GetDlgItemText (hDlg, ID_CONFIG_SMTP_SERVER, SMTPHost, MAXNNTPSIZE); 
  3150.       GetDlgItemText (hDlg, ID_CONFIG_NNTP_PORT, pszMyNNTPPort, MAXSTR);
  3151.       GetDlgItemText (hDlg, ID_CONFIG_AUTH_USERNAME, NNTPUserName, MAXNNTPSIZE);
  3152.       GetDlgItemText (hDlg, ID_CONFIG_AUTH_PASSWORD, NNTPPassword, MAXNNTPSIZE);
  3153.       MRREncrypt((unsigned char *)NNTPPassword,strlen(NNTPPassword)+1,
  3154.         NNTPPasswordEncrypted);
  3155.       NNTPPort = atoi (pszMyNNTPPort);
  3156.       AskComm = IsDlgButtonChecked (hDlg, ID_CONFIG_ASK_COMM);
  3157. d171 4
  3158. a174 4
  3159.       if (write_ini)
  3160.         {
  3161. /*          WritePrivateProfileString
  3162.         (szAppName, "CommString", szCommString, szAppProFile);
  3163. d176 15
  3164. a190 15
  3165.           WritePrivateProfileString
  3166.         (szAppName, "NNTPHost", NNTPHost, szAppProFile);
  3167.           WritePrivateProfileString
  3168.         (szAppName, "SMTPHost", SMTPHost, szAppProFile);
  3169.           WritePrivateProfileString
  3170.         (szAppName, "NNTPPort", pszMyNNTPPort, szAppProFile);
  3171.             WritePrivateProfileString
  3172.         (szAppName, "NNTPUserName", NNTPUserName, szAppProFile);
  3173.             WritePrivateProfileString
  3174.         (szAppName, "NNTPPassword", NNTPPasswordEncrypted, szAppProFile);
  3175.  
  3176.           WritePrivateProfileInt (szAppName, "MailForceType",
  3177.                       saveMailForceType, szAppProFile);
  3178.           WritePrivateProfileInt (szAppName, "MailDemandLogon",
  3179.                       MailDemandLogon, szAppProFile);
  3180. d193 3
  3181. a195 3
  3182.           cptr = MyCommModeID == ID_COMMTCP ? "1" : "0";
  3183.           WritePrivateProfileString (szAppName, "UseSocket", cptr, szAppProFile);
  3184.           WritePrivateProfileInt (szAppName, "AskComm", AskComm, szAppProFile);
  3185. d197 10
  3186. a206 10
  3187.         }
  3188.       if (saveMailForceType!=MailForceType)
  3189.       {/* change of mail transport medium
  3190.           Not entirely correct as may change from
  3191.           explicit selection to auto detect which
  3192.           in this case will (but in reality may not)
  3193.           affect a relogin to mail)  */
  3194.           MailForceType=saveMailForceType;
  3195.           MailCrashExit(hDlg);
  3196.           MailInit (hDlg);
  3197. d208 2
  3198. a209 2
  3199.       EndDialog (hDlg, TRUE);
  3200.       break;
  3201. d211 3
  3202. a213 3
  3203.     case IDCANCEL:
  3204.       EndDialog (hDlg, FALSE);
  3205.       break;
  3206. d216 17
  3207. a232 17
  3208.     case ID_COMMTCP:
  3209.     case ID_COMMSERIAL:
  3210.       MyCommModeID = wParam;
  3211.       CheckRadioButton (hDlg, ID_COMMTCP, ID_COMMSERIAL, MyCommModeID);
  3212.       break;
  3213.  
  3214.     case IDD_COM1:
  3215.     case IDD_COM2:
  3216.       MyCommPortID = wParam;
  3217.       CheckRadioButton (hDlg, IDD_COM1, IDD_COM2, wParam);
  3218.       break;
  3219.  
  3220.     case IDD_7EVEN:
  3221.     case IDD_8NONE:
  3222.       MyCommParityID = wParam;
  3223.       CheckRadioButton (hDlg, IDD_7EVEN, IDD_8NONE, wParam);
  3224.       break;
  3225. d235 10
  3226. a244 10
  3227.     case IDD_MAIL_SELECT_NONE:
  3228.     case IDD_MAIL_SELECT_MAPI:      
  3229.     case IDD_MAIL_SELECT_SMTP:
  3230.       saveMailForceType = wParam - IDD_MAIL_SELECT_NONE;
  3231.       enableDemandLogonCtl(hDlg,saveMailForceType) ;
  3232.       break;
  3233.  
  3234.     case IDD_MAIL_SELECT_AUTO:
  3235.       saveMailForceType = -1;
  3236.       enableDemandLogonCtl(hDlg,saveMailForceType) ;
  3237. d247 8
  3238. a254 8
  3239.     case IDD_DEMANDLOGON:
  3240.       SaveDemand = !SaveDemand;
  3241.       CheckDlgButton (hDlg, IDD_DEMANDLOGON, SaveDemand);
  3242.       break;
  3243.  
  3244.     default:
  3245.       return FALSE;
  3246.     }
  3247. d344 24
  3248. a367 24
  3249.     {
  3250.     case IDOK:
  3251.       GetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName, MAXFILENAME - 1);
  3252.  
  3253.       SaveArtAppend = MyAppend;
  3254.       if (!MRRWriteDocument (ActiveArticleDoc, sizeof (TypText), SaveArtFileName, SaveArtAppend))
  3255.         {
  3256.           MessageBox (hWndConf, "Could not write to file", "Problems saving file", MB_OK | MB_ICONEXCLAMATION);
  3257.         }
  3258.       EndDialog (hDlg, TRUE);
  3259.       break;
  3260.  
  3261.     case IDCANCEL:
  3262.       EndDialog (hDlg, FALSE);
  3263.       break;
  3264.  
  3265.     case IDD_APPEND:
  3266.       MyAppend = !MyAppend;
  3267.       CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  3268.       break;
  3269.  
  3270.     default:
  3271.       return FALSE;
  3272.     }
  3273. d406 20
  3274. a425 20
  3275.     {
  3276.     case IDOK:
  3277.       GetDlgItemText (hDlg, IDD_FILENAME, SaveArtFileName, MAXFILENAME - 1);
  3278.  
  3279.       SaveArtAppend = MyAppend;
  3280.       EndDialog (hDlg, TRUE);
  3281.       break;
  3282.  
  3283.     case IDCANCEL:
  3284.       EndDialog (hDlg, FALSE);
  3285.       break;
  3286.  
  3287.     case IDD_APPEND:
  3288.       MyAppend = !MyAppend;
  3289.       CheckDlgButton (hDlg, IDD_APPEND, MyAppend);
  3290.       break;
  3291.  
  3292.     default:
  3293.       return FALSE;
  3294.     }
  3295. d459 14
  3296. a472 14
  3297.     {
  3298.     case IDOK:
  3299.       GetDlgItemText (hDlg, IDD_SEARCH_STRING, FindDoc->SearchStr, MAXFINDSTRING - 1);
  3300.  
  3301.       EndDialog (hDlg, TRUE);
  3302.       break;
  3303.  
  3304.     case IDCANCEL:
  3305.       EndDialog (hDlg, FALSE);
  3306.       break;
  3307.  
  3308.     default:
  3309.       return FALSE;
  3310.     }
  3311. d506 15
  3312. a520 15
  3313.     {
  3314.     case IDOK:
  3315.       GetDlgItemText (hDlg, IDD_SUBJECT_STRING,
  3316.               DialogString, MAXDIALOGSTRING - 1);
  3317.  
  3318.       EndDialog (hDlg, TRUE);
  3319.       break;
  3320.  
  3321.     case IDCANCEL:
  3322.       EndDialog (hDlg, FALSE);
  3323.       break;
  3324.  
  3325.     default:
  3326.       return FALSE;
  3327.     }
  3328. d549 2
  3329. a550 2
  3330.     {
  3331.     case IDOK:
  3332. d552 2
  3333. a553 2
  3334.       EndDialog (hDlg, TRUE);
  3335.       break;
  3336. d555 1
  3337. a555 1
  3338.     case IDCANCEL:
  3339. d557 2
  3340. a558 2
  3341.       EndDialog (hDlg, FALSE);
  3342.       break;
  3343. d560 3
  3344. a562 3
  3345.     default:
  3346.       return FALSE;
  3347.     }
  3348. d604 27
  3349. a630 27
  3350.     {
  3351.     case ID_OK_SAVE:
  3352.       write_ini = TRUE;
  3353.     case IDOK:
  3354.       GetDlgItemText (hDlg, ID_CONFIG_NAME, UserName, MAILLEN - 1);
  3355.       GetDlgItemText (hDlg, ID_CONFIG_EMAIL, MailAddress, MAILLEN - 1);
  3356.       GetDlgItemText (hDlg, ID_CONFIG_ORG, Organization, MAILLEN - 1);
  3357.  
  3358.       if (write_ini)
  3359.         {
  3360.           WritePrivateProfileString (szAppName, "UserName", UserName, szAppProFile);
  3361.           WritePrivateProfileString (szAppName, "MailAddress", MailAddress, szAppProFile);
  3362.           WritePrivateProfileString (szAppName, "Organization", Organization, szAppProFile);
  3363.         }
  3364.       dialog_val = TRUE;
  3365.       goto endit;
  3366.       break;
  3367.  
  3368.     case IDCANCEL:
  3369.       dialog_val = FALSE;
  3370.     endit:;
  3371.       EndDialog (hDlg, dialog_val);
  3372.       break;
  3373.  
  3374.     default:
  3375.       return FALSE;
  3376.     }
  3377. d659 1
  3378. d672 2
  3379. a673 1
  3380.       CheckDlgButton (hDlg, ID_CONFIG_THREADS, threadp);
  3381. d682 78
  3382. a759 59
  3383.     {
  3384.     case ID_OK_SAVE:
  3385.       write_ini = TRUE;
  3386.     case IDOK:
  3387.       SaveArtAppend = (IsDlgButtonChecked (hDlg, ID_CONFIG_APPEND) != 0);
  3388.       ViewNew = (IsDlgButtonChecked (hDlg, ID_CONFIG_NEW_WND_GROUP) != 0);
  3389.       NewArticleWindow = (IsDlgButtonChecked (hDlg, ID_CONFIG_NEW_WND_ARTICLE) != 0);
  3390.       ArticleFixedFont = (IsDlgButtonChecked (hDlg, ID_CONFIG_ARTICLE_FIXED_FONT) != 0);
  3391.       FullNameFrom = (IsDlgButtonChecked (hDlg, ID_CONFIG_FULLNAMEFROM) != 0);
  3392.       threadp = (IsDlgButtonChecked (hDlg, ID_CONFIG_THREADS) != 0);
  3393.       GetDlgItemText(hDlg,IDD_ART_THRESHOLD,threshold,5);
  3394.  
  3395.       /* 0 or a bogus value means they don't want a threshold */
  3396.       article_threshold = atoi (threshold);
  3397.       if (!article_threshold)
  3398.         article_threshold = INT_MAX;
  3399.  
  3400.       for (item = ID_DOLIST_BASE; item <= ID_DOLIST_ASK; item++)
  3401.         {
  3402.           if (IsDlgButtonChecked (hDlg, item))
  3403.         {
  3404.           DoList = item - ID_DOLIST_BASE;
  3405.         }
  3406.         }
  3407.  
  3408.       if (write_ini)
  3409.         {
  3410.           WritePrivateProfileInt
  3411.         (szAppName, "SaveArtAppend", SaveArtAppend, szAppProFile);
  3412.           WritePrivateProfileInt
  3413.         (szAppName, "NewWndGroup", ViewNew, szAppProFile);
  3414.           WritePrivateProfileInt
  3415.         (szAppName, "NewWndArticle", NewArticleWindow, szAppProFile);
  3416.           WritePrivateProfileInt
  3417.         (szAppName, "DoList", DoList, szAppProFile);
  3418.           WritePrivateProfileInt
  3419.         (szAppName, "ArticleFixedFont", ArticleFixedFont, szAppProFile);
  3420.           WritePrivateProfileInt
  3421.         (szAppName, "ArticleThreshold", article_threshold, szAppProFile);
  3422.           WritePrivateProfileInt
  3423.         (szAppName, "FullNameFrom", FullNameFrom, szAppProFile);
  3424.  
  3425.           WritePrivateProfileInt
  3426.         (szAppName, "EnableThreading", threadp, szAppProFile);
  3427.  
  3428.         }
  3429.       dialog_val = TRUE;
  3430.       goto endit;
  3431.       break;
  3432.  
  3433.     case IDCANCEL:
  3434.       dialog_val = FALSE;
  3435.     endit:;
  3436.       EndDialog (hDlg, dialog_val);
  3437.       break;
  3438.  
  3439.     default:
  3440.       return FALSE;
  3441.     }
  3442. d791 34
  3443. a824 34
  3444.     {
  3445.     case ID_OK:
  3446.       GetDlgItemText (hDlg, IDD_ARTS_TO_GRAB, manual, 6);
  3447.       arts_to_retrieve = atoi (manual);
  3448.       if (arts_to_retrieve > 0)
  3449.         EndDialog (hDlg, TRUE);
  3450.       break;
  3451.  
  3452.     case ID_100_ARTS:
  3453.  
  3454.       arts_to_retrieve = 100;
  3455.       EndDialog (hDlg, TRUE);
  3456.       break;
  3457.  
  3458.     case ID_250_ARTS:
  3459.  
  3460.       arts_to_retrieve = 250;
  3461.       EndDialog (hDlg, TRUE);
  3462.       break;
  3463.  
  3464.     case ID_500_ARTS:
  3465.  
  3466.       arts_to_retrieve = 500;
  3467.       EndDialog (hDlg, TRUE);
  3468.       break;
  3469.  
  3470.     case ID_THRESHOLD_ALL:
  3471.       arts_to_retrieve = -1;
  3472.       EndDialog (hDlg, TRUE);
  3473.       break;
  3474.       
  3475.     default:
  3476.       return FALSE;
  3477.     }
  3478. d885 1
  3479. a885 1
  3480. //      EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  3481. d888 3
  3482. a890 3
  3483.       EnableWindow(GetDlgItem(hDlg,IDD_MAILLOG),(MailCtrl.MailType != MT_MAPI));
  3484.       EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),
  3485.          (MailCtrl.MailType != MT_MAPI)&&SaveMailLog);
  3486. d897 6
  3487. a902 6
  3488.     {
  3489.     case ID_OK_SAVE:
  3490.       write_ini = TRUE;
  3491.     case IDOK:
  3492.       GetDlgItemText (hDlg,  IDD_MAILNAME, MailLogFile, MAXFILENAME - 1);
  3493.       GetDlgItemText (hDlg,  IDD_POSTNAME, PostLogFile, MAXFILENAME - 1);
  3494. d904 1
  3495. a904 1
  3496.       MailLog = SaveMailLog;
  3497. d907 4
  3498. a910 4
  3499.       if (!MRRWriteDocument (ActiveArticleDoc, sizeof (TypText), SaveArtFileName, SaveArtAppend))
  3500.         {
  3501.           MessageBox (hWndConf, "Could not write to file", "Problems saving file", MB_OK | MB_ICONEXCLAMATION);
  3502.         }
  3503. d912 37
  3504. a948 37
  3505.       if (write_ini)
  3506.         {
  3507.           WritePrivateProfileString
  3508.         (szAppName, "MailLogFile", MailLogFile, szAppProFile);
  3509.           WritePrivateProfileString
  3510.         (szAppName, "PostLogFile", PostLogFile, szAppProFile);
  3511.  
  3512.           WritePrivateProfileInt (szAppName, "MailLog",
  3513.                       MailLog, szAppProFile);
  3514.           WritePrivateProfileInt (szAppName, "PostLog",
  3515.                       PostLog, szAppProFile);
  3516.  
  3517.         }
  3518.  
  3519.  
  3520.       EndDialog (hDlg, TRUE);
  3521.       break;
  3522.  
  3523.     case IDCANCEL:
  3524.       EndDialog (hDlg, FALSE);
  3525.       break;
  3526.  
  3527.     case IDD_MAILLOG:
  3528.       SaveMailLog = !SaveMailLog;
  3529.       CheckDlgButton (hDlg, IDD_MAILLOG, SaveMailLog);
  3530.       EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  3531.       break;
  3532.  
  3533.     case IDD_POSTLOG:
  3534.       SavePostLog = !SavePostLog;
  3535.       CheckDlgButton (hDlg, IDD_POSTLOG, SavePostLog);
  3536.       EnableWindow(GetDlgItem(hDlg,IDD_POSTNAME),SavePostLog);
  3537.       break;
  3538.  
  3539.     default:
  3540.       return FALSE;
  3541.     }
  3542. @
  3543.  
  3544.  
  3545.  
  3546. 1.14
  3547. log
  3548. @MRB merge, mail & post logging
  3549. @
  3550. text
  3551. @d1 1
  3552. d4 1
  3553. a4 1
  3554.  * $Id: wvcncm.c 1.13 1993/08/25 17:05:17 mbretherton Exp $
  3555. d6 3
  3556. @
  3557.  
  3558.  
  3559.  
  3560. 1.13
  3561. log
  3562. @merge from first newsrc.zip
  3563. @
  3564. text
  3565. @d3 1
  3566. a3 1
  3567.  * $Id: wvcncm.c 1.12 1993/08/05 20:06:07 jcoop Exp $
  3568. d7 7
  3569. d132 1
  3570. d857 1
  3571. a857 1
  3572.       EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),SaveMailLog);
  3573. d860 3
  3574. a862 2
  3575.       EnableWindow(GetDlgItem(hDlg,IDD_MAILLOG),!(MailCtrl.MailType == MT_MAPI));
  3576.       EnableWindow(GetDlgItem(hDlg,IDD_MAILNAME),!(MailCtrl.MailType == MT_MAPI));
  3577. @
  3578.  
  3579.  
  3580.  
  3581. 1.12
  3582. log
  3583. @save multiple articles changes by jcoop@@oakb2s01.apl.com (John S Cooper)
  3584. @
  3585. text
  3586. @d3 1
  3587. a3 1
  3588.  * $Id: wvcncm.c 1.11 1993/07/13 16:03:04 riordan Exp $
  3589. d5 7
  3590. d57 2
  3591. a59 1
  3592.  
  3593. d77 1
  3594. d111 1
  3595. d120 4
  3596. d154 1
  3597. d173 3
  3598. a175 1
  3599.                       MailForceType, szAppProFile);
  3600. d183 10
  3601. d223 2
  3602. a224 1
  3603.       MailForceType = wParam - IDD_MAIL_SELECT_NONE;
  3604. d228 7
  3605. a234 1
  3606.       MailForceType = -1;
  3607. d248 13
  3608. d334 1
  3609. a334 1
  3610.       if (!MRRWriteDocument (ActiveArticleDoc, sizeof (TypText), SaveArtFileName, SaveArtvRef, SaveArtAppend))
  3611. d828 93
  3612. @
  3613.  
  3614.  
  3615.  
  3616. 1.11
  3617. log
  3618. @MRR mods
  3619. @
  3620. text
  3621. @d3 1
  3622. a3 1
  3623.  * $Id: wvcncm.c 1.10 1993/06/26 00:25:11 rushing Exp $
  3624. d5 3
  3625. d291 58
  3626. @
  3627.  
  3628.  
  3629.  
  3630. 1.10
  3631. log
  3632. @warnings
  3633. @
  3634. text
  3635. @d3 1
  3636. a3 1
  3637.  * $Id: wvcncm.c 1.9 1993/06/25 20:49:28 dumoulin Exp rushing $
  3638. d5 3
  3639. d70 1
  3640. d95 3
  3641. d131 4
  3642. d149 4
  3643. a719 2
  3644.  
  3645.  
  3646. @
  3647.  
  3648.  
  3649.  
  3650. 1.9
  3651. log
  3652. @Cleaned up compiler warnings
  3653. @
  3654. text
  3655. @d3 1
  3656. a3 1
  3657.  * $Id: wvcncm.c 1.8 1993/06/22 19:44:42 rushing Exp dumoulin $
  3658. d5 3
  3659. d38 1
  3660. d557 1
  3661. a557 1
  3662.         article_threshold = (int) 999999L;
  3663. @
  3664.  
  3665.  
  3666.  
  3667. 1.8
  3668. log
  3669. @fixed IDD_MAIL_SELECT_AUTO
  3670. @
  3671. text
  3672. @d3 1
  3673. a3 1
  3674.  * $Id: wvcncm.c 1.7 1993/06/22 19:09:14 rushing Exp rushing $
  3675. d5 3
  3676. d63 1
  3677. a63 1
  3678.   char *cptr;
  3679. d553 1
  3680. a553 1
  3681.         article_threshold = 999999L;
  3682. @
  3683.  
  3684.  
  3685.  
  3686. 1.7
  3687. log
  3688. @mail force type selection via dialog
  3689. @
  3690. text
  3691. @d3 1
  3692. a3 1
  3693.  * $Id: wvcncm.c 1.6 1993/05/28 17:18:00 rushing Exp rushing $
  3694. d5 3
  3695. d58 1
  3696. a58 1
  3697.  
  3698. a59 1
  3699.   int mail_force_radio;
  3700. d87 2
  3701. d91 1
  3702. a91 1
  3703.             IDD_MAIL_SELECT_AUTO, MailForceType + IDD_MAIL_SELECT_NONE);
  3704. @
  3705.  
  3706.  
  3707.  
  3708. 1.6
  3709. log
  3710. @Added Misc... option to enable threading
  3711. @
  3712. text
  3713. @d3 1
  3714. a3 1
  3715.  * $Id: wvcncm.c 1.5 1993/05/24 23:24:26 rushing Exp rushing $
  3716. d5 3
  3717. d57 1
  3718. d82 7
  3719. d127 4
  3720. d163 11
  3721. @
  3722.  
  3723.  
  3724.  
  3725. 1.5
  3726. log
  3727. @change NNTPHost->SMTP Host for Comm... Dialog
  3728. @
  3729. text
  3730. @d3 1
  3731. a3 1
  3732.  * $Id: wvcncm.c 1.4 1993/05/18 22:10:45 rushing Exp rushing $
  3733. d5 3
  3734. d496 1
  3735. d514 1
  3736. d546 4
  3737. @
  3738.  
  3739.  
  3740.  
  3741. 1.4
  3742. log
  3743. @smtp support
  3744. @
  3745. text
  3746. @d3 1
  3747. a3 1
  3748.  * $Id: wvcncm.c 1.3 1993/05/13 19:59:11 rushing Exp rushing $
  3749. d5 3
  3750. d72 1
  3751. a72 1
  3752.       SetDlgItemText (hDlg, ID_CONFIG_SMTP_SERVER, NNTPHost);
  3753. @
  3754.  
  3755.  
  3756.  
  3757. 1.3
  3758. log
  3759. @fancy 'from' in group window
  3760. @
  3761. text
  3762. @d3 1
  3763. a3 1
  3764.  * $Id: wvcncm.c 1.2 1993/05/13 16:17:00 rushing Exp rushing $
  3765. d5 3
  3766. d69 1
  3767. d94 1
  3768. d107 2
  3769. d307 1
  3770. a307 1
  3771. WinVnSubjectDlg (hDlg, iMessage, wParam, lParam)
  3772. a312 2
  3773.   static int MyAppend;
  3774.  
  3775. d317 3
  3776. a319 1
  3777.       SetDlgItemText (hDlg, IDD_SUBJECT_STRING, SubjectString);
  3778. d327 2
  3779. a328 1
  3780.       GetDlgItemText (hDlg, IDD_SUBJECT_STRING, SubjectString, MAXSUBJECTSTRING - 1);
  3781. @
  3782.  
  3783.  
  3784.  
  3785. 1.2
  3786. log
  3787. @article fetch limit dialog box
  3788. @
  3789. text
  3790. @d3 1
  3791. a3 1
  3792.  * $Id: wvcncm.c 1.1 1993/02/16 20:53:50 rushing Exp rushing $
  3793. d5 3
  3794. d481 1
  3795. d498 1
  3796. a498 1
  3797.  
  3798. d516 14
  3799. a529 6
  3800.           WritePrivateProfileInt (szAppName, "SaveArtAppend", SaveArtAppend, szAppProFile);
  3801.           WritePrivateProfileInt (szAppName, "NewWndGroup", ViewNew, szAppProFile);
  3802.           WritePrivateProfileInt (szAppName, "NewWndArticle", NewArticleWindow, szAppProFile);
  3803.           WritePrivateProfileInt (szAppName, "DoList", DoList, szAppProFile);
  3804.           WritePrivateProfileInt (szAppName, "ArticleFixedFont", ArticleFixedFont, szAppProFile);
  3805.           WritePrivateProfileInt (szAppName, "ArticleThreshold", article_threshold, szAppProFile);
  3806. @
  3807.  
  3808.  
  3809.  
  3810. 1.1
  3811. log
  3812. @Initial revision
  3813. @
  3814. text
  3815. @d3 4
  3816. a6 2
  3817.  * $Id$
  3818.  * $Log$
  3819. d8 1
  3820. d48 1
  3821. d61 1
  3822. d74 3
  3823. a76 1
  3824.       GetDlgItemText (hDlg, IDD_SPEED, pszCommSpeed, MAXCOMMSPEEDCHARS - 1);
  3825. d84 2
  3826. a90 1
  3827.  
  3828. d93 8
  3829. a100 3
  3830.           WritePrivateProfileString (szAppName, "CommString", szCommString, szAppProFile);
  3831.           WritePrivateProfileString (szAppName, "NNTPHost", NNTPHost, szAppProFile);
  3832.           WritePrivateProfileString (szAppName, "NNTPPort", pszMyNNTPPort, szAppProFile);
  3833. d104 1
  3834. d113 1
  3835. a119 2
  3836.  
  3837.  
  3838. d131 1
  3839. a131 1
  3840.  
  3841. d467 1
  3842. a467 1
  3843.  
  3844. d478 2
  3845. d495 7
  3846. d517 1
  3847. d542 65
  3848. d636 2
  3849. @
  3850.  
  3851.